Because I am tired of writing Ajax and the development speed is slow, I have integrated the jquery class library and integrated it into the development project shamelessly. 0.0 the following are the $. Ajax ({data}) method in jquery to return JSON data.
The jquery Ajax method obtains asynchronous data. Currently, system. Web. Script. serialization is referenced on the Framework 3.5 platform. JSON data can also be obtained. Today we are writing about the implementation based on the Framework 2.0 platform.
// Background data protected void page_load (Object sender, eventargs e) {response. clear (); response. write ("{status: 'y', message: 'returned data status is y'}"); response. end ();}
<SCRIPT type = "text/JavaScript"> $ ("# BTN "). click (function () {$. ajax ({type: "Get", URL: "ajax_sources.aspx", cache: True, success: excute}) ;}( "# Div "). ajaxsend (function () {response (this%.html ("sending request ..... ") ;}); function excute (data) {eval (" Var DATA = ". concat (data); // note this. S if (data. Status = "Y") {alert (data. Message) ;}}</SCRIPT>
</pead>