Question about sending a data request from an Ajax object to a server

Source: Internet
Author: User
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 & g 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 );

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.