function copyUrl () { var div = document.getElementById('xxxx'); if (document.body.createTextRange) { var range = document.body.createTextRange(); range.moveToElementText(div); range.select(); } else if (window.getSelection) { var selection = window.
前几天写了一个时间函数setInterval,然后出现了这个错误:Uncaught ReferenceError: dosave is not defined(…) 找了半天都没发现错在哪,最后找到解决方法,正确写法如下: js: 方法名 = function (){ alert("方法名在前"); } 下面这种写法有时候会出现错误: function dosave(){ alert("方法名在后"); }