Interface:
Copy Code code as follows:
<script>
$ (document). Ready (function () {
$ ("#b01"). Click (function () {
Htmlobj = $.ajax ({URL: "/content/upfile/test. txt", async:false});
$ ("#div01"). HTML (htmlobj.responsetext);
});
});
$ (document). Ready (function () {
$ ("#test"). Load ("/content/upfile/test 2.txt #p1", function (Responsetxt, statustxt, XHR) {
if (Statustxt = = "Success")
Alert ("External content loaded successfully!") "+ XHR);
if (Statustxt = = "Error")
Alert ("Error:" + xhr.status + ":" + xhr.statustext);
});
});
$ (document). Ready (function () {
$ ("#getbutton"). Click (function () {
$.get ("/downset/index", function (data, status) {
Alert ("Data:" + date + "\ n State:" + status);
});
});
});
$ (document). Ready (function () {
$ ("#postbutton"). Click (function () {
$.get ("/customerinformation/gets", {par: "ww"}, function (data, status) {
Alert ("Data:" + date + "\ n State:" + status);
$ ("#postText"). HTML (data);
});
});
});
</script>
<div id= "DIV04" >
<H2 id= "PostText" >post method will be displayed here after the download of the <input type= "button" value= "Post method gets" id= "Postbutton"/>
</div>
<div id= "div03" >
<H2 id= "GetText" >get method will be displayed here after the download of the <input type= "button" value= "Get Method gets" id= "Getbutton"/>
</div>
<div id= "Div02" >
The <H2 id= "Test" will be shown here </div>
<div id= "DIV01" >
</div>
<p>
<input type= "button" value= "Loaded" id= "B01"/>
</p>
Background:
Copy Code code as follows:
public string GetS (string par)
{
String content = "";
if (par. Equals ("ww"))
{
Content = "Cheng gong le";
}
Else
{
Content = "Shi bai le";
}
return content;
}