Home  >  Article  >  Web Front-end  >  jQuery ajax dataType value is text json Explore Share_jquery

jQuery ajax dataType value is text json Explore Share_jquery

WBOY
WBOYOriginal
2016-05-16 17:21:441107browse
Copy code The code is as follows:

dataType
Type: String
Expected The data type returned by the server. If not specified, jQuery will automatically make intelligent judgments based on the MIME information of the HTTP package. For example, the XML
MIME type is recognized as XML



Copy code The code is as follows:


< ;SCRIPT TYPE="text/javascript" src='jquery-1.8.2.min.js'>


dataType value is text

The dataType value is json


< /html>

index.php code
Copy code The code is as follows:

echo "1";
?>

index1.php code
Copy the code The code is as follows:

ECHO json_encode("1");
?>
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