The server-side tasks are usually logical operations based on the client's request, and the result response is returned. This response is usually in XML format (so the server side needs to use PHP's DOM to create the XML response)
1.PHP uses DOM to create XML responses for client-side JS parsing and then display in the page (so you need a skilled PHP dom API)
In fact, there are two ways to generate XML in PHP:
Using the DOM API; (method one)
The other is to directly echo the content of the XML; (method two)
See Example:
HTML page (contains three JS trigger functions: onmouseover, onmouseout, onclick; trigger its own function)
<!doctype html public "-//w3c//dtd html 4.0 tRANSITIONAL//en">
<title> Server PHP Ajax </title>
<script type="text/javascript" src="js.js"></script>
<span onmouseover="PHPechoXML()" onmouseout="PHPDOMXML()">Default Words</span>
<div id="show"></div>
divide<input type="text" id="firstNumber"/>by
<input type="text" id="secondNumber"/>
<input type="button" value="Send" onclick="CSparameter()"/>
<div id="result"></div>
</body>