search
HomeBackend DevelopmentPHP TutorialPHP中AJAX比较(转)

PHP AJAX 除了??人知的 SAJAX、JPSPAN (原名?ScriptServer) 之外,Sourceforge 近期可下?的 PHP AJAX 又多了 xajax 、AJASON、flxAJAX、AjaxAC。

?些都有供乘法?例程式(好像?成 AJAX 的 Hello world!) ,?然乘法?例只能??考,但至少可看出大致的架?。

[xajax]

xajax 最大的特色是支援 UTF-8 及 Smarty。而且 xajax ??站都是 AJAX,乘法?例?直接到?站的 Example 看。
(??太慢?可能??致 Javascript ?入不完全,以致於?站?法??)

在乘法?例中可以看出最大的特色是 client 端不用自己? callback。client 端送出?算?求? Server 端後,Server 端可以直接把?算?果?送到??元素上。

至於 Smarty 支援的部份,因? Client 端只需一行 $xajax->printJavascript(); 就可以?生 AJAX 所需的 Javascript,所以??大部份的 Template engine 也都支援。

[AJASON]

AJASON 只能在 PHP 5 的?境?行,?站上提供的?例?的相?清楚,乘法?例中提供了 function 、class 二?不同的使用方式,另外?有???理展示。至於?典的autocomplete 也值得一看。

[Flexible Ajax] (flxajax)

flxajax 主要是以 PHP5 ?的,有另外提供 PHP 4 的版本。?例只有提供乘法?例可看,而且 client 端的程式?切的不如前二者完整。

[AjaxAC]

AjaxAC 提供了四??算的?例。看?原始?後????相?的?,Client 端?要?程式告知哪些??元素要?成 widgets 才能交由 Server 端控制。而 Server 端竟然?有 Javascript Code (Callback),?然看起? event 部份??的很好,但是前後端的??根本完全混在一起,?在太?了。

??:

以乘法?例比?起?,我?人比?偏好 xajax ,最主要原因是??跟?面分的相?清楚。(?然 UTF-8 也是原因之一)

xajax ? Server 端程式握有的??元素有??的主控?,在架?程式?可以很清楚的把??完全放在 Server 端,Client 端只要??正?的?示?面及?送?求,?也是? ASP.Net 程式?所使用的方式。

在??? PHP AJAX 之中,xajax 比 flxajax、AjaxAC 更有?格?? Framework,可是 xajax 在 Sourceforge 上也只自?? library:

Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
PHP Email: Step-by-Step Sending GuidePHP Email: Step-by-Step Sending GuideMay 09, 2025 am 12:14 AM

PHPisusedforsendingemailsduetoitsintegrationwithservermailservicesandexternalSMTPproviders,automatingnotificationsandmarketingcampaigns.1)SetupyourPHPenvironmentwithawebserverandPHP,ensuringthemailfunctionisenabled.2)UseabasicscriptwithPHP'smailfunct

How to Send Email via PHP: Examples & CodeHow to Send Email via PHP: Examples & CodeMay 09, 2025 am 12:13 AM

The best way to send emails is to use the PHPMailer library. 1) Using the mail() function is simple but unreliable, which may cause emails to enter spam or cannot be delivered. 2) PHPMailer provides better control and reliability, and supports HTML mail, attachments and SMTP authentication. 3) Make sure SMTP settings are configured correctly and encryption (such as STARTTLS or SSL/TLS) is used to enhance security. 4) For large amounts of emails, consider using a mail queue system to optimize performance.

Advanced PHP Email: Custom Headers & FeaturesAdvanced PHP Email: Custom Headers & FeaturesMay 09, 2025 am 12:13 AM

CustomheadersandadvancedfeaturesinPHPemailenhancefunctionalityandreliability.1)Customheadersaddmetadatafortrackingandcategorization.2)HTMLemailsallowformattingandinteractivity.3)AttachmentscanbesentusinglibrarieslikePHPMailer.4)SMTPauthenticationimpr

Guide to Sending Emails with PHP & SMTPGuide to Sending Emails with PHP & SMTPMay 09, 2025 am 12:06 AM

Sending mail using PHP and SMTP can be achieved through the PHPMailer library. 1) Install and configure PHPMailer, 2) Set SMTP server details, 3) Define the email content, 4) Send emails and handle errors. Use this method to ensure the reliability and security of emails.

What is the best way to send an email using PHP?What is the best way to send an email using PHP?May 08, 2025 am 12:21 AM

ThebestapproachforsendingemailsinPHPisusingthePHPMailerlibraryduetoitsreliability,featurerichness,andeaseofuse.PHPMailersupportsSMTP,providesdetailederrorhandling,allowssendingHTMLandplaintextemails,supportsattachments,andenhancessecurity.Foroptimalu

Best Practices for Dependency Injection in PHPBest Practices for Dependency Injection in PHPMay 08, 2025 am 12:21 AM

The reason for using Dependency Injection (DI) is that it promotes loose coupling, testability, and maintainability of the code. 1) Use constructor to inject dependencies, 2) Avoid using service locators, 3) Use dependency injection containers to manage dependencies, 4) Improve testability through injecting dependencies, 5) Avoid over-injection dependencies, 6) Consider the impact of DI on performance.

PHP performance tuning tips and tricksPHP performance tuning tips and tricksMay 08, 2025 am 12:20 AM

PHPperformancetuningiscrucialbecauseitenhancesspeedandefficiency,whicharevitalforwebapplications.1)CachingwithAPCureducesdatabaseloadandimprovesresponsetimes.2)Optimizingdatabasequeriesbyselectingnecessarycolumnsandusingindexingspeedsupdataretrieval.

PHP Email Security: Best Practices for Sending EmailsPHP Email Security: Best Practices for Sending EmailsMay 08, 2025 am 12:16 AM

ThebestpracticesforsendingemailssecurelyinPHPinclude:1)UsingsecureconfigurationswithSMTPandSTARTTLSencryption,2)Validatingandsanitizinginputstopreventinjectionattacks,3)EncryptingsensitivedatawithinemailsusingOpenSSL,4)Properlyhandlingemailheaderstoa

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Dreamweaver Mac version

Dreamweaver Mac version

Visual web development tools

SAP NetWeaver Server Adapter for Eclipse

SAP NetWeaver Server Adapter for Eclipse

Integrate Eclipse with SAP NetWeaver application server.

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

MantisBT

MantisBT

Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.

DVWA

DVWA

Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software