Tag Archives: javascript

jQuery 1.5.1 RC 1

從 jQuery 1.5.0 出來以後 (2011/1/31) 沒幾天又準備要出 1.5.1 了,剛剛在官方的公告「jQuery 1.5.1 RC 1 Released」上公佈了 1.5.1 RC 1 的連結 (讓人測試),以及大量的 bugfix 資訊… 昨天看了幾個報社的網站,發現不少網站都用 jQuery:(看首頁的部份) 聯合新聞網:1.4.2 (local server) 中時電子報:1.3.2 (Google CDN) 蘋果日報 (台灣):1.4.2 (Google CDN) 而「自由時報電子報」首頁沒有看到 jQuery…

Posted in Computer, Murmuring, Network, Programming, Software | Tagged , , , , | Leave a comment

jQuery CDN failover 的方式…

之前有在其他網站上看到 failover 的技巧,但剛剛才發現 jQuery 官方網站上也用上了類似的技巧,將 Google (ajax.googleapis.com) 與 EdgeCast (code.jquery.com) 的 CDN: <script src=”http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js”></script> <script>!window.jQuery && document.write(‘<script src=”http://code.jquery.com/jquery-1.4.2.min.js”><\/script>’);</script> 雖然 jQuery 網站上是放在開頭,但放在 HTML 最後面也有一樣的效果…

Posted in CDN, Computer, Murmuring, Network, Programming, Software, WWW | Tagged , , , | 1 Comment

jQuery 對效能的調整…

Twitter 將 jQuery 1.4.2 換到 1.4.4 以後,發現在捲頁時的效能變得很差:「About that slowness on Twitter…」。 這件事情讓 John Resig 在他的 blog 上發表了一篇文章,發現原因在「$something.find(“.class”)」這種用法,成為壓死駱駝的最後一根稻草:「Learning from Twitter」。主要的原因是 querySelectorAll(“.class”) 比起 getElementsByClassName() 慢了一些,而 Twitter 的寫法會使得這個 function 的效能明顯放大到影響整體效能的程度… 文章以及 comment 有給一些建議 (cache selector 與針對 scroll event 的處理),記起來以後應該會有幫助…

Posted in Computer, Murmuring, Network, Programming, Software, WWW | Tagged , , | Leave a comment

Head JS:非同步讀取 script 並且依照相依性執行

從 ihower 的 Twitter 上看到的,看起來相當好用的東西:「Head JS :: The only script in your HEAD」,官方網站的程式碼就相當容易懂了,這邊就不再列出範例了… 由於以往要作到類似效果並不太容易 (okay,我知道某 library 可以做,但… *消音*),Head JS 的出現以及好用的程度 (容易上手),可以使得網站大幅提昇頁面讀取速度。 手上舊的 project 可能就放著吧,但新的 project 應該會用…

Posted in Computer, Murmuring, Network, Software, WWW | Tagged , , , , , | Leave a comment

UglifyJS – 更強大的 JS Compressor

John Resig 在 Twitter 上提到 UglifyJS 還可以對 .min.js 版本再壓 700bytes: It seems like the UglifyJS minifier shaves about 700B off the gzipped size of jQuery. Will explore more, already impressed. 號稱比 YUI Compressor 更強大,比 Google Closure Compiler 更穩定… 用 node.js … Continue reading

Posted in Computer, Murmuring, Programming, Software | Tagged , , | 1 Comment

jQuery 1.4.3 正式釋出

如前幾天在「jQuery 1.4.3-RC* 開跑」所說的,jQuery 1.4.3 如期正式釋出:「jQuery 1.4.3 Released」,除了可以自己下載以外,在 Google Libraries API 上也已經更新了:ajax.googleapis.com/ajax/libs/jquery/1.4.3/jquery.min.js。 對於 dev quality 的要求,這個版本導入 JSLint,要求所有 jQuery code 都要 pass JSLint 的檢查。 另外把一些模組的相依性處理的更好,儘量都拆開不要相依,這樣可以使用 LABjs 或 RequireJS 這類工具動態讀入。 在效能改善的部份,這次把 .css() 重新寫過,大約快 20%,對於 .animate() 會有幫助,不過 Chrome 以及 IE8 似乎沒差… 最重要,改善幅度也最多的的應該是 .closest()、.filter() 的改善,以及連帶大量使用這兩個 … Continue reading

Posted in Computer, Murmuring, Network, Programming, Software, WWW | Tagged , | Leave a comment

jQuery 1.4.3-RC* 開跑

jQuery 在出了 2010/2/19 出了 1.4.2 之後,過了半年總算有 1.4.3 的消息了。預定在 10/16 要放出 1.4.3 正式版,這幾天正在做最後的測試:10/10 的「jQuery 1.4.3 Release Candidate 1 Released」,以及 10/12 的「jQuery 1.4.3 Release Candidate 2 Released」。 這半年最主要的變化應該是 HTML5 的興起,所以可以看到很多針對 HTML5 而做的修改。 另外九月的時候 Jeff Roberson (不是 FreeBSD committer 那位) 對 jQuery 所使用的 … Continue reading

Posted in Computer, Murmuring, Network, Programming, Software, WWW | Tagged , | 1 Comment

evercookie – 想辦法在瀏覽器留下紀錄…

evercookie 是一套想辦法在瀏覽器上留下可供紀錄的痕跡的 javscript library,支援非常多方法,想盡辦法產生類似 HTTP cookie 的效果… 從標準的 HTTP cookie、Flash 的 Local Shared Object,以及 HTML5 規格中的各類 Storage 外,另外還想實做 Web History 與 ETags!這真的不知道該說什麼了… XD HTTP cookie 可以用內建設定保護,而 Flashblock、BetterPrivacy 可以擋 Flash 的 LSO 部份,至於其他的還要再找看看有沒有解…

Posted in Browser, Computer, Murmuring, Network, Programming, Security, Software, WWW | Tagged , , , , , , , | 2 Comments

jQuery Mobile

jQuery Mobile 前幾天在 jQuery 的官方網誌上公告出來了:「The jQuery Project is Proud to Announce the jQuery Mobile Project」。 不過照「Mobile Graded Browser Support」的表來看,這… 前途一片荊棘啊… XD

Posted in Browser, Computer, Murmuring, Network, Software, WWW | Tagged , , , | 1 Comment