随笔分类 -  JavaScript

摘要:$("标签名") //取html元素 document.getElementsByTagName("")$("#ID") //取单个控件document.getElementById("")$("div #ID") //取某个控件中 控件$("#ID #ID") // 通过控件ID取其中的控件$("标签.class样式名") //通过class来取控件$("#ID").val(); //取value值$("#ID") 阅读全文
posted @ 2011-07-27 11:23 Silence-01
摘要:$(document).ready(function () { document.onkeydown = kp; function kp(e) { e = window.event || e; var obj = e.target || e.srcElement; //获取事件源 var k = e.keyCode || e.which; //获取作为判断条件的事件类型 var vReadOnly = obj.getAttribute('readonly'); var vEnabled = obj.getAttribute('enabled'); if (k = 阅读全文
posted @ 2011-07-08 15:43 Silence-01 阅读(378) 评论(0) 推荐(0)
摘要:<form id="form1" runat="server"> <a onclick="javascript:changefs('16');" style="cursor: pointer">大</a> <a onclick="javascript:changefs('14');" style="cursor: pointer">中</a> <a onclick="j 阅读全文
posted @ 2011-06-17 09:47 Silence-01 阅读(2652) 评论(0) 推荐(1)
摘要:<script type="text/javascript">function openwindow(url,name,iWidth,iHeight){var url; //转向网页的地址;var name; //网页名称,可为空;var iWidth; //弹出窗口的宽度;var iHeight; //弹出窗口的高度;var iTop = (window.screen.availHeight-30-iHeight)/2; //获得窗口的垂直位置;var iLeft = (window.screen.availWidth-10-iWidth)/2; //获得窗口 阅读全文
posted @ 2011-06-14 23:49 Silence-01 阅读(3560) 评论(0) 推荐(0)
摘要:JavaScript打开窗口函数(Window.Open)使用详解一、Location对象的使用简介location对象:location提供了关于当前打开窗口或者特定框架的url信息。一个多框架的窗口对象在location属性显示的是父窗口的URL,每个框架也有一个与之相伴的location对象。 hash属性:hash标注是一个url很好的习惯用法,它指定浏览器到一个位于文档中的anchor位置,相当于一个书签儿。host属性:描述渔歌url的主机名和端口,只有端口号是url的一个明确部分时,值中才包括端口号。hostname属性:一个典型的url的主机名是网络上服务器的名字,该网络存储有 阅读全文
posted @ 2011-06-14 22:54 Silence-01 阅读(900) 评论(0) 推荐(0)
摘要:<input type ="button" value ="OK" onclick="btn('text')" /> <br /> <input type ="text" id="text"/>----------------------------------------------------------------var xmlhttp;function loadXMLDoc() { if (window.XMLHttpRequest) 阅读全文
posted @ 2011-05-26 10:03 Silence-01 阅读(182) 评论(0) 推荐(0)
摘要:obj表示:<div id="obj"></div>function input(obj) { var img = document.createElement("img"); img.src = "11.gif"; img.id = "img1"; var btn = document.createElement("input"); btn.type = "button"; btn.value = "click"; btn.onc 阅读全文
posted @ 2011-05-26 09:53 Silence-01 阅读(164) 评论(0) 推荐(0)