[WordPress] 外掛分享: AJAX Manufactory

首頁外掛目錄 › AJAX Manufactory
WordPress 外掛 AJAX Manufactory 的封面圖片
100+
安裝啟用
★★★★★
5/5 分(5 則評價)
2456 天前
最後更新
問題解決
WordPress 3.0.1+ v1.7.11 上架:2015-09-06

內容簡介

當您計劃使用 AJAX 技術在 WordPress 上開發應用程序時,您必須解決許多與應用程序的邏輯無關的小問題:

如何打包和傳輸從瀏覽器到服務器的數據,以便它們不會失真?
如果數據是多維數組,如何傳輸數據?
如果 AJAX 響應表示複雜的數據集(一個典型的示例是表單發送並在服務器端驗證),如何實現自定義 AJAX 響應處理?
如何處理數據傳輸錯誤?
如何調試所有這些問題?

通常,這些問題會產生大量的代碼,此外,每種新的請求類型都需要對代碼進行一些自定義。這樣管理所有這些問題,您就會忘記您想要實現的功能。

WordPress 的 AJAX Manufactory 外掛已經解決了大部分這些問題。您可以專注於功能和業務邏輯。

您可以從盒子中獲得以下內容:

在客戶端提供一個簡單的函數,允許從JavaScript 將任何您複雜的數據發送到 WordPress 服務器端。
在服務器端提供一個 AJAX 響應包裝器,將發送的數據作為 PHP 數組發送給您,並允許您創建 AJAX 響應作為一組簡單的“命令”,例如“生成提示”、“設置JavaScript 變量”、“將 HTML 文本放入特定的 HTML 节点中”、“執行 JavaScript 函数”、“轉到特定 URL”等。
在客戶端自動執行“命令”隊列。此外,您還可以指定自己的回調。

文檔

請參閱 文檔。

外掛標籤

開發者團隊

⬇ 下載最新版 (v1.7.11) 或搜尋安裝

① 下載 ZIP → 後台「外掛 › 安裝外掛 › 上傳外掛」
② 後台搜尋「AJAX Manufactory」→ 直接安裝(推薦)
📦 歷史版本下載

原文外掛簡介

Whenever you plan to begin developing applications on WordPress using AJAX technology, you have to solve a number of
minor issues unrelated to the logic of your application:

How to package and transmit data from the browser to the server, so they will not have been distorted?
How to transfer data, if they are multi-dimensional array?
How to implement a custom processing of AJAX response in case, again, it represents a complex set of data (a typical
example – form sending and on-server validation)?
How to handle data transition errors?
How to debug all this stuff?

Usually these issues generates a lot of spaghetti code, moreover, each new request type requires some customization of
code. Managing all of this, you forget about the function that you would like to implement.
AJAX Manufactory plugin for WordPress have most of these tasks already solved. You can think about functionality and
business logic instead.
What you can have from the box:

A simple function at the client side which allows to send any your complex data from javascript to WordPress server
side.
An AJAX response wrapper at the server side which gives to you sent data as PHP array and allows you to create
an AJAX response as a set of simple “commands” like “make an alert”, “set up javascript variable”, “put html text to
specific html node(s)”, “execute a javascript function”, “go to specific URL” etc.
Automatic execution of “commands” queue at the client side. Additionally you can specify your own callback.

Documentation
Please refer Documentation.

延伸相關外掛

文章
Filter
Apply Filters
Mastodon