Microsoft Script Debugger
設定 網際網路選項 > 進階
........
[v] 每次出現指令碼錯誤時皆顯示通知
........
........
[ ] 停用指令碼除錯[Internet
Explorer]
[ ] 停用指令碼除錯(其他)
coolouis 發表在 痞客邦 留言(0) 人氣(402)
The style property gives access to these inline styles, it will always overrule all other styles.
The general rule is that all dashes are removed from the CSS property names, and that the character after a dash becomes uppercase.
margin-left becomes marginLeft, text-decoration becomes textDecoration, and border-left-style becomes borderLeftStyle.
coolouis 發表在 痞客邦 留言(0) 人氣(29)
// Get dom element by id
function $(id){return
document.getElementById(id);}
coolouis 發表在 痞客邦 留言(0) 人氣(15)
Finding elements
[Long-distance travel]
Through the getElementById() and
getElementsByTagName() methods.
coolouis 發表在 痞客邦 留言(0) 人氣(19)
文件參考 : http://code.google.com/p/trimpath/wiki/JavaScriptTemplates
coolouis 發表在 痞客邦 留言(0) 人氣(22)
function posX(elmt) {
var x = 0;
//繞行 offsetParents
for (var e = elmt ; e ; e = e.offsetParent) {
//把 offsetLeft 值加總
x += e.offsetLeft;
}
//繞行至 document.body
for (e = elmt.parentNode; e && e != document.body; e = e.parentNode){
//減去捲軸值
if (e.scrollLeft) x -= e.scrollLeft;
}
return x;
}
function posY(emlt) {
var y = 0;
//繞行 offsetParents
for (var e = elmt ; e ; e = e.offsetParent) {
//把 offsetTop 值加總
y += e.offsetTop;
}
//繞行至 document.body
for (e = elmt.parentNode; e && e != document.body; e = e.parentNode){
//減去捲軸值
if (e.scrollTop) y -= e.scrollTop;
}
return y;
}
coolouis 發表在 痞客邦 留言(0) 人氣(49)
無侵入性是近幾年相當盛行的JavaScript設計觀念,它主張JavaScript不應該對網頁原始碼以及使用者造成干擾。為了達成這個訴求,首要的目標就是讓HTML標記與JavaScript程式保持分離,讓內容與行為能清楚畫分為二,因此可以透過模組化的方式,使JavaScript不與HTML文件混雜在一起。同時,也要能確保如果不能執行JavaScript時,網頁一樣能正常運作。
舉個例子
<img id="myImg" src="11.jpg" onmouseover="this.src='22.jpg'" onmouseout="this.src='11.jpg'" />
可以改成
document.getElementById("myImg").onmouseover = function(){this.src="22.jpg"};
document.getElementById("myImg").onmouseout = function(){this.src="11.jpg"};
coolouis 發表在 痞客邦 留言(0) 人氣(106)
雖然這個 JavaScript 的小工具我不是很建議大家使用,但是如果 code 不想讓人清楚地馬上解讀,進行些微的減少縮排和編碼卻是個不錯的方法。在使用時要記的註解述敘的使用,最好以 /* comment */ 包起來。
Sample:
function show()
{
alert("Hello World");
}
coolouis 發表在 痞客邦 留言(0) 人氣(71)
當沒有 jQuery 或 Prototype 使用時, 該如何使用 javascript 提供的原生方法操作 html dom 和 event 行為呢 ?
詳細可以參考:http://www.w3schools.com/HTMLDOM/
以下是自己常用到的方法
window
alert(),prompt(),confirm()
open(),close()
moveBy(),moveTo()
resizeBy(),resizeTo()
scrollBy(),scrollTo()
setInterval(),setTimeout()
clearInterval(),clearTimeout()
print()
coolouis 發表在 痞客邦 留言(0) 人氣(48)
5 Axis Rotary Table Profile Grinder CNC Tilting Table Centerless Grinder Double Column Machining Center Surface Grinder CNC Internal Grinder
coolouis 發表在 痞客邦 留言(0) 人氣(30)