Optimization and performance

When building modern Web apps and sites, it's important to make your content perform well. That is, to make it work quickly and efficiently. This lets it work effectively both for users of powerful desktop systems as well as for handheld devices with less power.

使用 web workers
Web Workers 提供一條簡單的方法讓網頁在背景執行緒(Thread)中執行程式。一個worker可以藉由傳送訊息到web worker創造端設定的事件處理器來和這個創造端產生的任務傳遞訊息。然而,web workers其實是在不同於目前視窗(window)的另一個全域環境下工作的(透過window來取得目前worker所在的全域物件將會導致錯誤,正確應該透過self)。

文件標籤與貢獻者

 此頁面的貢獻者: Sheppy
 最近更新: Sheppy,