Title: Ajax Comment Preview
Author: Michael Adams (mdawaffe)
Published: <strong>2006 年 9 月 26 日</strong>
Last modified: 2012 年 3 月 6 日

---

搜尋外掛

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

![](https://s.w.org/plugins/geopattern-icon/ajax-comment-preview.svg)

# Ajax Comment Preview

 由 [Michael Adams (mdawaffe)](https://profiles.wordpress.org/mdawaffe/) 開發

[下載](https://downloads.wordpress.org/plugin/ajax-comment-preview.2.4.zip)

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

 [技術支援](https://wordpress.org/support/plugin/ajax-comment-preview/)

## 外掛說明

Other preview plugins don’t know what sort of changes WordPress will make to a
 
visitor’s comment, but this plugin uses AJAX and other buzzwords to send each previewed
comment through WordPress’ inner voodoo.

The result? With the click of a button, your site’s visitors can preview their
 
comments _exactly_ as they will appear when they submit them for realies.

Requires PHP5.

## 安裝方式

 1. Upload the plugin (the whole folder the plugin came with) to your plugins
     folder:`
    wp-content/plugins/`
 2. Activate the ‘Ajax Comment Preview’ plugin from the Plugins admin panel.
 3. Go to the Options -> Ajax Comment Preview admin panel to configure the look
     of
    the preview.

## 常見問題集

  How do I change the look of the preview?

Go to the Settings (called “Options” in WordPress 2.6 ) -> Ajax Comment Preview

admin panel. From there you’ll be able to specify the markup used to display the
comment being previewed. The markup you enter will depend on what theme your site
is using. If you’re using Kubrick (the default theme for WordPress), the settings
that come installed with the plugin will work fine. For other themes, I suggest 
the following.

 1. Go to the permalink page for a post on your site that has a few comments.
 2. In your web browser, view the Page Source of that page. You can usually do
     this
    by finding that option in your browsers Edit or View menu or in the menu that pops
    up when you right click on the page.
 3. Find the section of code that corresponds to one of the comments. Copy it
     into
    your clipboard.
 4. Paste that code into the big text box in the Options -> Ajax Comment Preview
     admin
    panel.
 5. Replace the text specific to that comment (author name, time, comment text,
     …)
    with the plugin’s special tags (`%author%`, `%date%`, `%content%`, …).
 6. Most themes’ code has all the comments inside one big `<ol>`, `<ul>`, or `<div>`
    
    tag. You’ll probably need to put your preview markup inside that “parent” tag too.
    Make sure it has the same class(es) as the tag in your theme’s code.

  I click preview and nothing happens. What do I do?

Remember, you have to have WordPress version 2.6 or higher to use this plugin. If
you do:

 1. Go to the plugin’s Settings page. Copy the HTML from the big text box to a _text_
    file
     (not a Word document) and save it. Now you have a backup.
 2. Delete everything in the big text box.
 3. Type “TEST” (_without_ the quote marks) in the big text box, then hit the “Update”
    button.
 4. Go back to your blog, type in a comment and hit the preview button.
 5. If you see TEST come back, there’s probably a mistake in the HTML you entered in
    the big
     text box. Double check it and try again.

  I didn’t see TEST come back. Now what?

This plugin has two files: `ajax-comment-preview.php` and `ajax-comment-preview.
js` .
 Did you upload them both? (You did if you were a good blogger and followed
the directions.) Make sure both of those files are on your webserver and _in the
same directory_.

  I saw TEST come back, but my comments template doesn’t work, or only some of it
shows up

Are you serving your blog’s webpages as XML documents (for example with the MIME
type
 application/xhtml+xml)? If so (or if you don’t know what that means), try 
putting xmlns=”http://www.w3.org/1999/xhtml” inside the very first HTML tag of your
comment template. So if you had:

    ```
    <li class="comment">
    ```

as the first line in your comment template, change it to

    ```
    <li class="comment" xmlns="http://www.w3.org/1999/xhtml">
    ```

in the big text box.

  Still no luck. Any more ideas?

… Can you tell if there are any JavaScript errors when you load a post on your blog
or
 when you click the preview button?

Other than that, nope, I’m out of ideas.

## 使用者評論

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

### 󠀁[Does what it says](https://wordpress.org/support/topic/does-what-it-says-670/)󠁿

 [angeljs](https://profiles.wordpress.org/angeljs/) 2018 年 2 月 10 日

Great plugin, just what I needed for my comments section. 🙂

 [ 閱讀全部 3 則使用者評論 ](https://wordpress.org/support/plugin/ajax-comment-preview/reviews/)

## 參與者及開發者

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

參與者

 *   [ Michael Adams (mdawaffe) ](https://profiles.wordpress.org/mdawaffe/)
 *   [ Mark Jaquith ](https://profiles.wordpress.org/markjaquith/)

[將〈Ajax Comment Preview〉外掛本地化為台灣繁體中文版](https://translate.wordpress.org/projects/wp-plugins/ajax-comment-preview)

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

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

## 變更記錄

#### 2.4

 * Replace some deprecated WP functions.
 * Fix some PHP notices.

#### 2.3

 * Compatibility with new Twenty Ten default theme.
 * Use admin-ajax.php instead of hack.

#### 2.2

 * Add setting link to plugins page.
 * Compatibility with WordPress 2.9.

## 中繼資料

 *  版本 **2.4**
 *  最後更新 **14 年前**
 *  啟用安裝數 **50+**
 *  WordPress 版本需求 ** 3.1 或更新版本 **
 *  已測試相容的 WordPress 版本 **3.3.2**
 *  語言
 * [English (US)](https://wordpress.org/plugins/ajax-comment-preview/)
 * 標籤:
 * [ajax](https://tw.wordpress.org/plugins/tags/ajax/)[comment](https://tw.wordpress.org/plugins/tags/comment/)
   [comments](https://tw.wordpress.org/plugins/tags/comments/)[preview](https://tw.wordpress.org/plugins/tags/preview/)
 *  [進階檢視](https://tw.wordpress.org/plugins/ajax-comment-preview/advanced/)

## 評分

 4.3 星，滿分為 5 星

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

[撰寫評分](https://wordpress.org/support/plugin/ajax-comment-preview/reviews/#new-post)

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

## 參與者

 *   [ Michael Adams (mdawaffe) ](https://profiles.wordpress.org/mdawaffe/)
 *   [ Mark Jaquith ](https://profiles.wordpress.org/markjaquith/)

## 技術支援

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

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