PIXNET Logo登入

村天來了

跳到主文

堅持、好學、耐心...成為一位快樂的廚師。

部落格全站分類:生活綜合

  • 相簿
  • 部落格
  • 留言
  • 名片
  • 7月 21 週二 200918:17
  • IE javascript 除錯工具


Microsoft Script Debugger
 
設定 網際網路選項 > 進階
........
[v] 每次出現指令碼錯誤時皆顯示通知
........
........
[ ] 停用指令碼除錯[Internet
Explorer]
[ ] 停用指令碼除錯(其他)
(繼續閱讀...)
文章標籤

coolouis 發表在 痞客邦 留言(0) 人氣(402)

  • 個人分類:JavaScript
▲top
  • 4月 21 週二 200911:57
  • [Note] ppk on javascript - CSS

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)

  • 個人分類:JavaScript
▲top
  • 4月 20 週一 200916:23
  • [Note] ppk on javascript - Events

 
// Get dom element by id
function $(id){return
document.getElementById(id);}

 
(繼續閱讀...)
文章標籤

coolouis 發表在 痞客邦 留言(0) 人氣(15)

  • 個人分類:JavaScript
▲top
  • 4月 20 週一 200915:42
  • [Note] ppk on javascript - DOM

 
Finding elements
[Long-distance travel]
Through the getElementById() and
getElementsByTagName() methods.
(繼續閱讀...)
文章標籤

coolouis 發表在 痞客邦 留言(0) 人氣(19)

  • 個人分類:JavaScript
▲top
  • 3月 21 週六 200922:30
  • JavaScript Templates

文件參考 : http://code.google.com/p/trimpath/wiki/JavaScriptTemplates
(繼續閱讀...)
文章標籤

coolouis 發表在 痞客邦 留言(0) 人氣(22)

  • 個人分類:JavaScript
▲top
  • 3月 21 週六 200922:26
  • 取得物件正確x和y座標

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
▲top
  • 1月 17 週六 200901:01
  • 無侵入式(Unobtrusive)JavaScript 設計

無侵入性是近幾年相當盛行的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
▲top
  • 12月 22 週一 200822:43
  • JavaScript Compressor

雖然這個 JavaScript 的小工具我不是很建議大家使用,但是如果 code 不想讓人清楚地馬上解讀,進行些微的減少縮排和編碼卻是個不錯的方法。在使用時要記的註解述敘的使用,最好以 /* comment */ 包起來。
Sample:
function show()
{
alert("Hello World");
}
(繼續閱讀...)
文章標籤

coolouis 發表在 痞客邦 留言(0) 人氣(71)

  • 個人分類:JavaScript
▲top
  • 12月 21 週日 200810:23
  • 當沒有 jQuery framework 使用時

當沒有 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)

  • 個人分類:JavaScript
▲top
  • 11月 02 週日 200820:12
  • Prototype v.s. jQuery











5 Axis Rotary Table Profile Grinder CNC Tilting Table Centerless Grinder Double Column Machining Center Surface Grinder CNC Internal Grinder


(繼續閱讀...)
文章標籤

coolouis 發表在 痞客邦 留言(0) 人氣(30)

  • 個人分類:JavaScript
▲top
1

文章分類

  • JavaScript (10)
  • PHP (6)
  • jQuery (14)
  • 影音收集 (1)
  • 軍旅回憶 (4)
  • 我的書架 (12)
  • 網站排名 (3)
  • 我的寵物 (4)
  • 生活記事 (20)
  • 未分類文章 (1)