Tag Archives: javascript

用 Google Analytics 紀錄 JavaScript 錯誤…

「Client-Side Error Logging With Google Analytics」這篇提到可以用 Google Analytics 紀錄 JavaScript 錯誤… 不過這不是即時的紀錄,倒是作者有提到可以交叉比對,當發生 JavaScript 錯誤對於其他參數的影響: Track the impact of client-side errors on other business metrics. With the reporting in Google Analytics you can see how these errors are affecting bounce rate, … Continue reading

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

Fabric Engine

Fabric Engine 號稱可以把 JavaScript 與 Python 跑到接近 C++ 速度的實力,而且強調支援 Threading… 投影片裡可以看到底層的技術包括 LLVM。 在 Python 的範例程式可以看到 import 後用專屬的 Handler 包起來:https://github.com/fabric-engine/PublicStable/blob/master/Examples/Python/Tutorial/trivialHTTPServer.py。而 NodeJS 的範例也是類似的架構:https://github.com/fabric-engine/PublicStable/blob/master/Examples/Node/Tutorial/trivialHTTPServer.js。看起來比較像是把常用的 module 寫成 C++ code 而已?這並不是什麼神奇的技術… 另外 license 是 AGPL 3 or later 這個麻煩的 license,再加上使用 GitHub 的方式超怪 (把 stable 版本與 … Continue reading

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

安裝 Pretty Beautiful Javascript…

Pretty Beautiful Javascript,這是安裝前看 jQuery 1.7.0 程式碼的效果: 這是安裝後的效果: 不過 javascript 檔案大一點跑起來就會很慢 XD

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

改用 jquery-ujs…

昨天聽 othree 提到 jquery-ujs (Unobtrusive scripting adapter for jQuery),裡面有不少 convention 可以直接套用。othree 在三月有寫一篇文章介紹:「jQuery-ujs」。 雖然 repository 看起來是給 RoR 使用,但直接把 rails.js 抓下來用「<script src=”rails.js”></script>」掛上來,還是可以用在非 RoR 環境裡。 直接看 code 也很好懂,舉幾個例子來說: <?php $sToken = hash(‘sha256′, session_id()); ?> <meta name=”csrf-token” content=”<?php echo $sToken; ?>”> <meta name=”csrf-param” content=”sToken”> … Continue reading

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

jQuery 1.7 版,並計畫瘦身 jQuery…

jQuery 1.7 前幾天丟出來了,可以看到很多對 event 操作的改善,包括效能與功能 (新增了 .on() 與 .off()):「jQuery 1.7 Released」。 另外今天又看到瘦身計畫:「Building a Slimmer jQuery」,希望把一些「應該要拿掉」或是「應該要被修正」的問題處理掉… 所以在 jQuery 1.7 標為 Deprecation,預定在下個主版本就會處理掉這些問題。 目前 (對我家) 最主要的影響應該是 .live() 會被拔掉,以及之前有使用 .attr(‘value’) 取 current value (要 current value 應該用 .val() 取得)。 看起來是往好的方面進行…

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

Google +1 按鈕的效率問題

在「Google +1 Button Performance Review」這篇中,Aaron Peters 對 Google +1 按鈕所提供的方法感到疑惑,因為官方所提供的方法效率其實並不好。 首先先拿出官方的 sample: <!– Place this tag in your head or just before your close body tag –> <script type=”text/javascript” src=”http://apis.google.com/js/plusone.js”></script> <!– Place this tag where you want the +1 button … Continue reading

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

在瀏覽器裡面的「Linux 模擬器」

QEMU 的作者 Fabrice Bellard 寫了一個 javascript-based 的 x86 emulator:「Javascript PC Emulator」,技術細節在「Javascript PC Emulator – Technical Notes」。 其中實做了 486-based CPU,沒有浮點運算能力,另外因為這是 for fun project,所以很多細節沒做 (Linux 開機沒用到的功能都沒做)。以「x86 instruction listings」這邊列出來的指令集,要做到 486 等級,大約 150 條上下? 真是感謝現在的瀏覽器把 javascript 做的這麼快…

Posted in Browser, Computer, Hardware, Murmuring, Software | Tagged , , , , , , , | Leave a comment

jQuery 1.5.1 釋出

jQuery 的官方 blog 宣佈 1.5.1 正式出版:「jQuery 1.5.1 Released」,除了 bugfix 外,也宣佈要開 1.6 Roadmap Meeting 討論下一個版本要做的事情,預定在 irc.freenode.net 的 #jquery-meeting 上開,時間是 3/7 (時區是 EST)。 這次 Google CDN 上已經有 1.5.1 版,需要的人可以改過去了…

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

Protocol Preserve URI 的過濾

雖然知道 //host.domain/path 這種 Relative Protocol 用法 (而且也用很久了),不過最近在 irc.perl.org 上的 #plack 剛好有人提到,再加上最近剛好有人在探討安全性問題:「Bypassing “RequestPolicy” Using Protocol Relative URLs」,剛好可以拿出來再說一次。 簡單來說就是「以 / 開頭的 URI 並非一定是 same origin,不可以以此當作 same origin 的判斷」。因為「//ajax.googleapis.com/ajax/libs/jquery/1.5.0/jquery.min.js」這種用法是正確的用法,表示保留 Protocol。 另外講些題外話,這個用法也還是有缺點,用在 IE 的 css 時會造成重複抓取 (到 IE9 都還是):「CSS files downloaded twice in Internet … Continue reading

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

Mobile Perf bookmarklet

Mobile Perf bookmarklet 在 Jacky 的 Twitter 上看到的工具,是由 Steve Souders 整理出來的,包括了七個 bookmarklet 工具,執行後就會像這樣: 拿來分析 performance issue 還不錯…

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