2011年2月24日
摘要: 很多时候 为了编程方便、快捷,我们经常定义全局变量 页面加载初始化并赋值 但是在此全局变量为控件对象时: var test; $(function () { test = document.getElementById("TextBox1"); }); function clk() { alert(test.value); } <asp:UpdatePanel ID="UpdatePanel1" runat="server"> <ContentTemplate> <div id="contain 阅读全文
posted @ 2011-02-24 17:41 纳兰_容若 阅读(776) 评论(0) 推荐(0) 编辑
摘要:  1 function getSelectionStart(o) 2 { 3 if (o.createTextRange) 4 { 5 var r = document.selection.createRange().duplicate() 6 r.moveEnd('character', o.value.length) 7 if (r.text == '') return o.value.length 8 return o.value.lastIndexOf(r.text) 9 } else return o.selectionStart10 } 阅读全文
posted @ 2011-02-24 17:30 纳兰_容若 阅读(192) 评论(0) 推荐(0) 编辑