摘要:
HTML代码:<html><head><title>Rating</title><script>function indexOf(arr,element){ for(var i=0;i<arr.length;i++){ if(arr[i]==element){ return i; } }}function InitEvent(){ var tds = document.getElementById("rating").getElementsByTagName("td"); for(var 阅读全文
摘要:
进入窗口后默认聚焦到某个文本框,两种方法:①设置tabindex把该文本框属性里的tabIndex设为0,焦点就默认在这个文本框里了。②Winform的Activated事件在Form的Activated事件中添加textBox1.Focus(), 即可获得焦点。 private void Form1_Activated(object sender, EventArgs e) { textBox1.Focus(); }TextBox是可以获得焦点的. 有几个前提:1. TextBox所属的窗体(Form)在可操作(Active)状态. 即用户选中了Form.2. TextBox的Enable属 阅读全文
摘要:
开发者最容易犯的JavaScript错误,总结出13个。这些当中可能少不了你犯的错误。我们描述了这些陋习,并列出来解决办法,希望对开发者有帮助。1.for...数组迭代的用法 Usage of for..in to iterate Arrays举例:varmyArray=[“a”,“b”,“c”]; vartotalElements=myArray.length; for(vari=0;i<totalElements;i++){ console.log(myArray[i]); } 这里主要的问题是语句中的“for..."不能保证顺序,这意味着你将获得不同的执行结果。此外,如果 阅读全文