随笔分类 -  JavaScript

javascript对象属性和数组的访问
摘要:javascript对象属性的访问 假如有对象test:var test = { "a":1, "b":2};直接访问对象test的属性a的值,有两种方法:1.test.a;2.test["a"]; (注意这里要用引号)但若是用for/in语句访问对象的属性值,则必须用“[]”运算符啦: for(m... 阅读全文

posted @ 2014-12-16 16:44 Paste 阅读(460) 评论(0) 推荐(0) 编辑

js undefined
摘要:var bbb1 = typeof str== 'undefined'; //truevar bbb2 = typeof str== undefined; //falsevar bbb3 = str== undefined; //truevar bbb4 = str== 'undefined'; /... 阅读全文

posted @ 2014-12-16 16:38 Paste 阅读(142) 评论(0) 推荐(0) 编辑

jquery页面滚动到指定id
摘要://jquery页面滚动到指定id $body = (window.opera) ? (document.compatMode == "CSS1Compat" ? $('html') : $('body')) : $('html,body');// 这行是 Opera 的补丁, 少了它 Opera ... 阅读全文

posted @ 2014-12-16 16:35 Paste 阅读(2010) 评论(0) 推荐(0) 编辑

给按钮在后台添加属性
摘要:this.Button1.Attributes.Add("onclick","javascript:if(confirm('继续吗?');"){return true;}else{return false;}"); 阅读全文

posted @ 2011-05-19 14:10 Paste 阅读(166) 评论(0) 推荐(0) 编辑

关闭页面不弹出提示框
摘要:--关闭页面不弹出提示框Response.Write("<script>alert('您无权操作!');window.opener=null;window.open('','_self');window.close();</script>");--点击alert确定后 跳转页面Response.Write("<script>alert('该名已经存在!');window.location.href='WebForm2.aspx'</script 阅读全文

posted @ 2011-05-19 14:06 Paste 阅读(181) 评论(0) 推荐(0) 编辑

JS选择html页面中的checkbox实现全选
摘要:<!--html--><input id="Checkbox2" type="checkbox" onclick="check(this)" />全选 &nbsp;<asp:Button ID="btnAddFuJian" runat="server" Text="添加所选附件" OnClick="btnAddFuJian_Click" OnClientClick="return lessthan();&qu 阅读全文

posted @ 2011-05-19 14:03 Paste 阅读(5096) 评论(0) 推荐(0) 编辑

js实现页面跳转的几种方式
摘要:第一种:<script language="javascript" type="text/javascript"> window.location.href="login.aspx?backurl="+window.location.href; </script>第二种:<script language="javascript">alert("返回");wind... 阅读全文

posted @ 2010-10-28 11:25 Paste 阅读(179) 评论(0) 推荐(0) 编辑

导航

点击右上角即可分享
微信分享提示