Title: Async JavaScript
Author: David Clough
Published: <strong>2014 年 12 月 11 日</strong>
Last modified: 2023 年 6 月 22 日

---

搜尋外掛

這個外掛**並未在最新的 3 個 WordPress 主要版本上進行測試**。開發者可能不再對這個
外掛進行維護或提供技術支援，並可能會與更新版本的 WordPress 產生使用上的相容性問題。

![](https://ps.w.org/async-javascript/assets/icon-128x128.png?rev=1839260)

# Async JavaScript

 由 [David Clough](https://profiles.wordpress.org/cloughit/) 開發

[下載](https://downloads.wordpress.org/plugin/async-javascript.2.21.08.31.zip)

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

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

## 外掛說明

Eliminate Render-blocking Javascript in above-the-fold content with Async Javascript.

Render-blocking Javascript prevents above-the-fold content on your page from being
rendered until the javascript has finished loading. This can impact on your page
speed and ultimately your ranking within search engines. It can also impact your
user’s experience.

Async JavaScript gives you full control of which scripts to add an ‘async’ or ‘defer’
attribute to or to exclude to help increase the performance of your WordPress website.

## 安裝方式

Installation is very straightforward:

 1. Upload the zip-file and unzip it in the /wp-content/plugins/ directory
 2. 在 WordPress 管理後台的 [外掛] 選單中啟用外掛。
 3. Go to `Settings` > `Async JavaScript` menu to load settings page

## 常見問題集

### Which browsers support the ‘async’ and ‘defer’ attributes

The ‘async’ attribute is new in HTML5. It is supported by the following browsers:

 * Chrome
 * IE 10 and higher
 * Firefox 3.6 and higher
 * Safari
 * Opera

### Where can I get help?

Async JavaScript is supported via [the wordpress.org support forum](https://wordpress.org/support/plugin/async-javascript).

### Do you offer professional support/ configuration services?

We offer premium services for Async JavaScript and full web performance optimization
services at [https://autoptimize.com/](https://autoptimize.com/?utm=asyncjs)

### What about CSS?

As the name implies, Async JavaScript is built to enhance JavaScript loading only.
Async JavaScript does not have any impact on CSS.

We recommend using the awesome [Autoptimize](https://wordpress.org/plugins/autoptimize/)
plugin alongside Async JavaScript for CSS optimization.

### I want out, how should I remove Async JavaScript?

 * Disable the plugin
 * Delete the plugin

## 使用者評論

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

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

 [lockbench](https://profiles.wordpress.org/lockbench/) 2023 年 8 月 2 日 1 則留言

A truly great plugin, does exactly what is describing. No extra stuff, great implementation
and great support! Thank you!

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

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

 [gaiusjaugustus](https://profiles.wordpress.org/gaiusjaugustus/) 2023 年 7 月 17
日 1 則留言

I’ve been using this plugin for several months after it was suggested to me by a
colleague. The setup was simple, but also gives advanced options that I needed, 
such as excluding certain scripts. I had an issue recently, and the developer provided
fast and helpful support! I definitely recommend this plugin.

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

### 󠀁[Performance promise delivered](https://wordpress.org/support/topic/performance-promise-delivered/)󠁿

 [W★](https://profiles.wordpress.org/filmpuls/) 2022 年 8 月 11 日 1 則留言

Exemplary support, and the plugin does exactly what it promises. This is unfortunately
not a given in a time when many other plugins try to cover more and more tasks and
end up in dangerous waters. Async JavaScript proves: Less is more.

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

### 󠀁[Essential and works great!](https://wordpress.org/support/topic/essential-and-works-great/)󠁿

 [maportugal](https://profiles.wordpress.org/maportugal/) 2022 年 3 月 14 日 1 則
留言

This is the typical installation plugin you can’t miss in your project. Fulfill 
what you promise to do.

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

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

 [tomraab90](https://profiles.wordpress.org/tomraab90/) 2021 年 12 月 27 日 1 則
留言

The plugin is easy to use. E.g with some videos on youtube. It improved our Google
Page Speed significantly. And when I had a support question I got feedback within
hours. Great Job. Keep up the good work

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

### 󠀁[It breaks the WpForo answer editor](https://wordpress.org/support/topic/it-breaks-the-wpforo-answer-editor/)󠁿

 [Sydney Chako](https://profiles.wordpress.org/sydchako/) 2021 年 11 月 9 日 3 則
留言

I love this plugin and I have been using it for a long time. It actually improved
my site stats on gtmetrix and pagespeed insights. However I recently added a forum
on my site using WpForo and found out that answer editor was failing to load. After
much research I discovered that this plugin is the one that was breaking the WpForo
answer editor so I decided to sacrifice it. I give 5 stars because, beside that 
tiny conflict, it works as advertised.

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

## 參與者及開發者

以下人員參與了開源軟體〈Async JavaScript〉的開發相關工作。

參與者

 *   [ David Clough ](https://profiles.wordpress.org/cloughit/)
 *   [ Optimizing Matters ](https://profiles.wordpress.org/optimizingmatters/)
 *   [ Frank Goossens ](https://profiles.wordpress.org/futtta/)
 *   [ EricJohnsonGuru ](https://profiles.wordpress.org/wormeyman/)

〈Async JavaScript〉外掛目前已有 7 個本地化語言版本。 感謝[全部譯者](https://translate.wordpress.org/projects/wp-plugins/async-javascript/contributors)
為這個外掛做出的貢獻。

[將〈Async JavaScript〉外掛本地化為台灣繁體中文版](https://translate.wordpress.org/projects/wp-plugins/async-javascript)

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

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

## 變更記錄

#### 2.21.08.31

 * workaround for issues with some inline JS getting asynced (hat tip to WP Bullet’s
   Mike)

#### 2.21.06.29

 * fix for an authenticated stored XSS vulnerability, credits to m0ze for discovering
 * confirmed working with WordPress 5.8 (beta)

#### 2.20.12.09

 * fix for some ternary operators warning in PHP 7.4 and up.
 * hard-exclude document.write (WordPress core injects inline JS that has `<script
   src` in it which AsyncJS acted on)
 * fix for WordPress 5.6 renaming jQuery from jquery.js into jquery.min.js

#### 2.20.03.01

 * extra security measure; check the nonce when saving settings/ going through wizard.
 * wizard: if something fails then communicate this onscreen instead of on the console.
 * autoptimize integration: change copy to explain this might or might not be helpful.

#### 2.20.02.27

 * fix for some nasty issues, thanks for the heads-up Mikey

#### 2.19.07.14

 * add `asyncjs_filter_noptimize` filter
 * changed textdomain to match slug as suggested by Eneko Garrido
 * confirmed working with WordPress 5.2

#### 2.18.12.10

 * the “happy birthday to me” edition 😉
 * new: added option to disable Async JS for logged in users
 * new: added option to disable Async JS on shop cart/ checkout pages (woocommerce,
   edd & wp ecommerce)
 * added ‘settings’-link to plugin overview screen (hi Mike!)
 * updated the [chosen JS library](https://harvesthq.github.io/chosen/) to 1.8.7
 * confirmed working with WordPress 5.0

#### 2.18.06.13

 * fix integration issue with Autoptimize, thx [for reporting](https://wordpress.org/support/topic/autoptimize-and-async-javascript/)
   ElephantDude!

#### 2.18.05.24

 * don’t async (or defer) on AMP-pages
 * disable async/ defer by when `?aj_noptimize=1` is part of the URL

#### 2.18.04.23

 * Re-arrange content on the different tabs of the settings page.
 * Continued refactoring of backend code, no functionality should be affected.
 * Remove all images from the project such as the animated hands and progress bar
   gif.
 * Remove empty rows that added unnecessary space.
 * Switch buttons to use WordPress button styles.
 * Fix broken Dashboard Widget from 2.18.03.15 and reduce font-size to fix text 
   overflow.
 * Remove all CSS !important declarations for easier CSS styling.
 * Remove inline CSS styles.
 * Switch to a CSS based progress bar.
 * Spell check readme.
 * Remove almost all tables from files.
 * Refactor JavaScript.
 * Add wormeyman as a contributor (thanks man!).

#### 2.18.03.15

 * bugfix: only load asyncjs’ JS & CSS on own settings page [as reported by Marat Petrov](https://wordpress.org/support/topic/error-after-update-117/)
 * bugfix: check if jQuery chosen is correctly loaded before using it (based on 
   same report, thanks Marat!)
 * update jQuery Chosen lib
 * small readme tweaks

#### 2.18.03.10

 * ASync JS is now maintained by Frank Goossens (Optimizing Matters), thanks for
   the great job done David!
 * Moved all Pro features into the standard version.
 * Some code refactoring
 * Made strings ready for translations

#### 2.17.11.15

 * MOD: Added User Agent to GTMetrix requests

#### 2.17.11.03

 * MOD: Check for GTMetrix class existence prior to including class

#### 2.17.10.18

 * FIX: Issue converting array for plugin & theme exclusions

#### 2.17.09.30

 * FIX: Sanitise all $_GET and all $_POST
 * FIX: Add nonce to ajax calls

#### 2.17.06.13

 * MOD: Dashboard Widget and Notices only available to Administrators

#### 2.17.05.08

 * NEW: Added quick settings buttons to allow common settings to be quickly applied
 * NEW: Added current version info to help page

#### 2.17.05.07

 * FIX: Some installs not saving plugin/theme exclusions due to theme incompatibility

#### 2.17.05.06

 * MOD/FIX: On some WordPress installs is_plugin_active function being called too
   early. Moved is_plugin_active into a dedicated function called via admin_init
   as per codex: https://codex.wordpress.org/Function_Reference/is_plugin_active

#### 2.17.05.05

 * FIX: Incorrect textarea identifier preventing exclusion save

#### 2.17.05.04

 * FIX: Resolve early loading of plugin causing a fatal error due to function not
   available yet
 * FIX: CSS / JS not loading

#### 2.17.05.03

 * MOD: Add text to advise running Wizard is not mandatory

#### 2.17.05.01

 * massive Massive MASSIVE rewrite of Async JavaScript!!!
 * Now includes a Setup Wizard, Status page, Settings page and a help page.
 * Communicates directly with GTmetrix (account required)
 * Automatically transfers existing settings from Async JavaScript to Async JavaScript

## 中繼資料

 *  版本 **2.21.08.31**
 *  最後更新 **3 年前**
 *  啟用安裝數 **70,000+**
 *  WordPress 版本需求 ** 4.6 或更新版本 **
 *  已測試相容的 WordPress 版本 **6.2.9**
 *  語言
 * [Dutch](https://nl.wordpress.org/plugins/async-javascript/)、[English (US)](https://wordpress.org/plugins/async-javascript/)、
   [Italian](https://it.wordpress.org/plugins/async-javascript/)、[Spanish (Chile)](https://cl.wordpress.org/plugins/async-javascript/)、
   [Spanish (Colombia)](https://es-co.wordpress.org/plugins/async-javascript/)、
   [Spanish (Ecuador)](https://es-ec.wordpress.org/plugins/async-javascript/)、[Spanish (Spain)](https://es.wordpress.org/plugins/async-javascript/)、
   及 [Spanish (Venezuela)](https://ve.wordpress.org/plugins/async-javascript/).
 *  [將這個外掛本地化為你的母語版本](https://translate.wordpress.org/projects/wp-plugins/async-javascript)
 * 標籤:
 * [async](https://tw.wordpress.org/plugins/tags/async/)[javascript](https://tw.wordpress.org/plugins/tags/javascript/)
   [pagespeed](https://tw.wordpress.org/plugins/tags/pagespeed/)[performance](https://tw.wordpress.org/plugins/tags/performance/)
 *  [進階檢視](https://tw.wordpress.org/plugins/async-javascript/advanced/)

## 評分

 4.7 星，滿分為 5 星

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

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

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

## 參與者

 *   [ David Clough ](https://profiles.wordpress.org/cloughit/)
 *   [ Optimizing Matters ](https://profiles.wordpress.org/optimizingmatters/)
 *   [ Frank Goossens ](https://profiles.wordpress.org/futtta/)
 *   [ EricJohnsonGuru ](https://profiles.wordpress.org/wormeyman/)

## 技術支援

使用者可在技術支援論壇提出意見反應或使用問題。

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

## 贊助

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

 [ 贊助這個外掛 ](http://blog.futtta.be/2013/10/21/do-not-donate-to-me/)