摘要: hashCode = function(str){ var hash = 0; if (str.length == 0) return hash; for (i = 0; i < str.length; i++) { char = str.charCodeAt(i); hash = ((hash<<5)-hash)+char; hash = hash & hash; // Convert to 32bit integer } return hash;}djb2Code = function(str){ var has... 阅读全文
posted @ 2013-09-27 16:27 穆乙 阅读(14123) 评论(0) 推荐(2) 编辑
摘要: 1.动态创建selectfunction createSelect(){var mySelect = document.createElement_x("select"); mySelect.id = "mySelect"; document.body.appendChild(mySelect); }2.添加选项option function addOption(){ //根据id查找对象, var obj=document.getElementByIdx_x('mySelect'); //添加一个选项obj.add(new Option 阅读全文
posted @ 2013-09-27 15:57 穆乙 阅读(2984) 评论(0) 推荐(0) 编辑