12 2012 档案

摘要:原文出处:大家都不写出处,我也不知道到底原著作者是谁了...,只在此表明本文是转来的。js代码: function getValue(objid,str){ var myField=document.getElementById(""+objid); //IE浏览器 if (document.selection) { myField.focus(); sel = document.selection.createRange(); sel.text = str; s... 阅读全文
posted @ 2012-12-12 22:47 北方漂流 阅读(656) 评论(0) 推荐(0) 编辑
摘要:原文出处http://www.cnblogs.com/enone/archive/2010/12/09/1901429.htmljs代码:var $ = function(i) { return document.getElementById(i)};function moreshow() { var e = $('pkCityBx'); if (e.style.display != 'block') { e.style.display = 'block'; } else { e.style.display = 'none'; } 阅读全文
posted @ 2012-12-11 23:19 北方漂流 阅读(300) 评论(0) 推荐(0) 编辑
摘要:某天晚上写代码的时候,突然出了bug,想了很久都不知道问题出在哪里(其实是很简单的问题,但由于我还是个菜鸟,所以不知道)。几经周折,这中间的过程就不提了,终于让我在快崩溃的时候,发现了原因。原来是因为同一jquery元素可以重复绑定,当使用了嵌套绑定的时候,就容易出错。如代码:$('.test').bind('click',function(){ $('.last').bind('click',function(){ alert('nihao');});});<button class="test& 阅读全文
posted @ 2012-12-07 23:20 北方漂流 阅读(861) 评论(0) 推荐(1) 编辑