Title: Flying Scripts: 延遲載入 JavaScript 以改進網站速度及效能
Author: Gijo Varghese
Published: <strong>2020 年 2 月 6 日</strong>
Last modified: 2025 年 12 月 2 日

---

搜尋外掛

![](https://ps.w.org/flying-scripts/assets/banner-772x250.png?rev=2240429)

![](https://ps.w.org/flying-scripts/assets/icon-256x256.png?rev=2240444)

# Flying Scripts: 延遲載入 JavaScript 以改進網站速度及效能

 由 [Gijo Varghese](https://profiles.wordpress.org/gijo/) 開發

[下載](https://downloads.wordpress.org/plugin/flying-scripts.1.2.4.zip)

 * [詳細資料](https://tw.wordpress.org/plugins/flying-scripts/#description)
 * [使用者評論](https://tw.wordpress.org/plugins/flying-scripts/#reviews)
 *  [安裝方式](https://tw.wordpress.org/plugins/flying-scripts/#installation)
 * [開發資訊](https://tw.wordpress.org/plugins/flying-scripts/#developers)

 [技術支援](https://wordpress.org/support/plugin/flying-scripts/)

## 外掛說明

使用者互動時才下載及執行 JavaScript。

[示範影片](https://youtu.be/YJ8TQ3bh-TA)

Flying Scripts 會在沒有使用者活動時，延遲 JavaScript 的執行。網站管理員可以指定關鍵字，
以便納入要進行延遲的 JavaScript。這個外掛也可以設定為在超過一定時間即使沒有使用者
活動，還是執行 JavaScript。

### 網站應該使用這個外掛的原因

執行 JavaScript 會產生資源爭用的狀況。藉由延遲執行不重要、初始轉譯不需要的 JavaScript，
將重要的 JavaScript 檔案提升執行優先序及給予更多資源，並能讓網站降低轉譯時間、可
互動時間、首次 CPU 閒置、潛在輸入延遲上限等效能瓶頸，並能透過減少要求數量降低瀏覽器
的初始負載。

### 技術支援

 * [官方技術支援論壇](https://wordpress.org/support/plugin/flying-scripts/)
 * [Facebook 私密社團](https://www.facebook.com/groups/wpspeedmatters)

### 我們的付費外掛

 * [FlyingPress](https://flyingpress.com)
 * [FlyingCDN](https://flyingcdn.com)

### 我們的免費外掛

 * [Flying Pages](https://tw.wordpress.org/plugins/flying-pages/)
 * [Flying Images](https://tw.wordpress.org/plugins/nazy-load/)
 * [Flying Scripts](https://tw.wordpress.org/plugins/flying-scripts/)
 * [Flying Analytics](https://tw.wordpress.org/plugins/flying-analytics/)
 * [Flying Fonts](https://tw.wordpress.org/plugins/flying-fonts/)

#### 參與者

 * [WP Speed Matters 的 Gijo Varghese](https://wpspeedmatters.com/)
 * [Shay Toder](https://www.shaytoder.com/)

## 安裝方式

 1. 前往 [外掛] 頁面，並點擊 [安裝外掛]。
 2. 搜尋「Flying Scripts」。
 3. 在 WordPress 的 [外掛] 頁面啟用 Flying Scripts 外掛。
 4. 前往 [設定]→[Flying Scripts] 進行設定。

## 常見問題集

### 要納入哪些理想的指令碼？

任何不是用於繪製第一個檢視畫面捲動內容上方的不重要指令碼，第三方指令碼如追蹤指令
碼、對談外掛等，均是可納入的理想指令碼。

### 應該將哪些項目納入關鍵字中？

請納入內嵌指令碼中對該指令碼具備唯一識別作用的任何關鍵字。例如，用於 Facebook Pixel
的 `fbevents.js`、用於 Google Tag Manager 的 `gtag`，用於 Facebook Customer Chat
的 `customerchat.js`。

### 這與 defer 屬性的差異在何處？

defer 屬性會通知瀏覽器，在找到指令碼後下載指令碼並在 HTML 轉譯完成後加以執行；而
網站會在安裝了 Flying Scripts 並將指令碼納管後，只有在使用者互動時才執行這些指令
碼。

### 什麼是使用者互動？

使用者將游標暫留於連結上、捲動畫面、使用鍵盤輸入、在行動裝置上的操作等事件，都是**
使用者互動**。

### 什麼是逾時？

即使沒有發生使用者互動事件，指令碼也會在指定的逾時時間後執行。

## 使用者評論

![](https://secure.gravatar.com/avatar/a7276235fb250f091f56688568365e47d4536c5acc9b22873be5d89ded125a3e?
s=60&d=retro&r=g)

### 󠀁[Super straight-forward and effective.](https://wordpress.org/support/topic/super-straight-forward-and-effective/)󠁿

 [iz4atkal](https://profiles.wordpress.org/iz4atkal/) 2024 年 2 月 13 日

Highly recommended!

![](https://secure.gravatar.com/avatar/30324c0ec1c4654ed244fe986d5a2fe3fb34b57b51a52fdfe6f118258d27a5ab?
s=60&d=retro&r=g)

### 󠀁[Sehr gutes Plugin](https://wordpress.org/support/topic/sehr-gutes-plugin-102/)󠁿

 [twinsdz](https://profiles.wordpress.org/twinsdz/) 2023 年 10 月 12 日

It works very well. Thanks a lot.

![](https://secure.gravatar.com/avatar/39a336ddb501c6f443657c5a740dad7b612d3fce1455411b81acca3ddab0c5f9?
s=60&d=retro&r=g)

### 󠀁[Good and Efficient](https://wordpress.org/support/topic/good-and-efficient-2/)󠁿

 [steve-8bm](https://profiles.wordpress.org/steve-8bm/) 2023 年 1 月 31 日

Good and efficient plugin. 5 stars

![](https://secure.gravatar.com/avatar/f86070219511c5b402c783c8cfffd2707785224325ce59fa2229e300eedcb405?
s=60&d=retro&r=g)

### 󠀁[Instant results](https://wordpress.org/support/topic/instant-results-7/)󠁿

 [Tom Bush](https://profiles.wordpress.org/tom_nature/) 2023 年 1 月 7 日

Sooo easy to set up and a great way to deal with heavy JS from advertising etc. 
Really simple but brilliant approach to defer until user input. Pagespeed Insights
overall score went from 58/70 to 99/100 for mobile & desktop respectively without
any other changes (appreciate these values fluctuate anyway but that’s a significant
jump even +/- a few points on the final values).

![](https://secure.gravatar.com/avatar/d833cca3f0b7e6ae86625897ed4705c7bc76c9fde48cd2b549a0dc422f26aad6?
s=60&d=retro&r=g)

### 󠀁[Great Plugin](https://wordpress.org/support/topic/great-plugin-35360/)󠁿

 [Tony Hisir](https://profiles.wordpress.org/copperrefections/) 2022 年 10 月 26
日

It saved me a lot of time. Thank you for creating a wonderful plugin.

![](https://secure.gravatar.com/avatar/2813aac308407a596ce146203f2fb376e9768b5eea81313ad54c175b20a6fcdd?
s=60&d=retro&r=g)

### 󠀁[Awesome plugin solving third party performance issues](https://wordpress.org/support/topic/awesome-plugin-solving-third-party-performance-issues/)󠁿

 [Jundell Agbo](https://profiles.wordpress.org/jundellagbo/) 2022 年 7 月 27 日

Thank you for making this amazing plugin.

 [ 閱讀全部 38 則使用者評論 ](https://wordpress.org/support/plugin/flying-scripts/reviews/)

## 參與者及開發者

以下人員參與了開源軟體〈Flying Scripts: 延遲載入 JavaScript 以改進網站速度及效能〉
的開發相關工作。

參與者

 *   [ Gijo Varghese ](https://profiles.wordpress.org/gijo/)

[將〈Flying Scripts: 延遲載入 JavaScript 以改進網站速度及效能〉外掛本地化為台灣繁體中文版](https://translate.wordpress.org/projects/wp-plugins/flying-scripts)

### 對開發相關資訊感興趣？

任何人均可[瀏覽程式碼](https://plugins.trac.wordpress.org/browser/flying-scripts/)、
查看 [SVN 存放庫](https://plugins.svn.wordpress.org/flying-scripts/)，或透過 [RSS](https://plugins.trac.wordpress.org/log/flying-scripts/?limit=100&mode=stop_on_copy&format=rss)
訂閱[開發記錄](https://plugins.trac.wordpress.org/log/flying-scripts/)。

## 變更記錄

#### 1.2.4

 * Updated list of event listeners to trigger user interaction

#### 1.2.3

 * Increased DOM size limit
 * Updated “Optimize more” tab

#### 1.2.2

 * Fix – Added mouse wheel event for user interaction

#### 1.2.1

 * Fix – FacetWP compatibility

#### 1.2.0

 * New – Exclude on pages
 * New – Set timeout to Never

#### 1.1.9

 * Security updates

#### 1.1.8

 * [BUGFIX] Disable for admin interface when using W3 Total Cache

#### 1.1.7

 * [BUGFIX] Support for W3 Total Cache

#### 1.1.6

 * [REMOVED] Unnecessary “scroll” event

#### 1.1.5

 * [UPDATE] Set `data-type='lazy'` instead of `type='lazy'`. Removed setting `type
   ='text/javascript'` via JavaScript

#### 1.1.4

 * [BUGFIX] Remove event listeners after scripts are loaded

#### 1.1.3

 * [UPDATE] Copy updates

#### 1.1.2

 * [UPDATE] Minified JavaScript
 * [UPDATE] Updated copy, FAQ

#### 1.1.1

 * [BUGFIX] Exclude json and other script tags

#### 1.1.0

 * [NEW] Load scripts on user interaction
 * [REMOVED] Load scripts after delay

#### 1.0.0

 * Initial release

## 中繼資料

 *  版本 **1.2.4**
 *  最後更新 **6 個月前**
 *  啟用安裝數 **30,000+**
 *  WordPress 版本需求 ** 4.5 或更新版本 **
 *  已測試相容的 WordPress 版本 **6.9.4**
 *  PHP 版本需求 ** 5.6 或更新版本 **
 *  語言
 * [English (US)](https://wordpress.org/plugins/flying-scripts/)
 *  [進階檢視](https://tw.wordpress.org/plugins/flying-scripts/advanced/)

## 評分

 5 星，滿分為 5 星

 *  [  36 個 5 星使用者評論     ](https://wordpress.org/support/plugin/flying-scripts/reviews/?filter=5)
 *  [  1 個 4 星使用者評論     ](https://wordpress.org/support/plugin/flying-scripts/reviews/?filter=4)
 *  [  0 個 3 星使用者評論     ](https://wordpress.org/support/plugin/flying-scripts/reviews/?filter=3)
 *  [  0 個 2 星使用者評論     ](https://wordpress.org/support/plugin/flying-scripts/reviews/?filter=2)
 *  [  0 個 1 星使用者評論     ](https://wordpress.org/support/plugin/flying-scripts/reviews/?filter=1)

[Your review](https://wordpress.org/support/plugin/flying-scripts/reviews/#new-post)

[查看全部使用者評論](https://wordpress.org/support/plugin/flying-scripts/reviews/)

## 參與者

 *   [ Gijo Varghese ](https://profiles.wordpress.org/gijo/)

## 技術支援

最近 2 個月解決的問題:

     總計 2 個問題，已解決 0 個

 [檢視技術支援論壇](https://wordpress.org/support/plugin/flying-scripts/)

## 贊助

想要支援這個外掛的發展嗎？

 [ 贊助這個外掛 ](https://www.buymeacoffee.com/gijovarghese)