A newbie who sends a data request from an Ajax object to the server. Question: ajax.html sends a data request to the file server. php .. &Nbsp;here is the ajax.html code: HTMLcode & lt; html & gt; & lt; script & gt; functioncreateAjax () {Ajax object to send data requests to the server.
The problem is that Ajax.html sends data requests to the file server. php ..
The following is the Ajax.html code:
HTML code
Script function createAjax () {var Ajax = false; if (window. XMLHttpRequest) {// non-IE series, compliant with W3C standards, or IE7, IE8 Ajax = new window. XMLHttpRequest (); if (Ajax. overrideMimeType) {Ajax. overrideMimeType ("text/xml") ;}} else if (window. activeXObject) {// earlier version of the IE series var version = ['Microsoft. XMLHTTP ', 'msxml. XMLHTTP ', 'msxml2. XMLHTTP.7.0 ', 'msxml2. XMLHTTP.6.0 ', 'msxml2. XMLHTTP.5.0 ', 'msxml2. XMLHTTP.4.0 ', 'msxml2. XMLHTTP.3.0 ', 'msxml2. XMLHTTP ']; for (var I = 0; I
This is the server. php code:
PHP code
Why cannot I generate the save.txt file in my root directory ..
------ Solution --------------------
Change the ajax transmission method to get
------ Solution --------------------
Ajax. open ("get", "server. php? Name = tianxiaokang & age = 22 & "+ Math. random (), true );