Interface:
Copy codeThe Code is 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:" + data + "\ n status:" + status );
});
});
});
$ (Document). ready (function (){
$ ("# Postbutton"). click (function (){
$. Get ("/CustomerInformation/getS", {par: "ww"}, function (data, status ){
Alert ("data:" + data + "\ n status:" + status );
$ ("# PostText" pai.html (data );
});
});
});
</Script>
<Div id = "div04">
<H2 id = "postText"> after the post method loads the text, it is displayed here <Input type = "button" value = "post method" id = "postbutton"/>
</Div>
<Div id = "div03">
<H2 id = "getText"> after the get method loads the text, it is displayed here <Input type = "button" value = "get method" id = "getbutton"/>
</Div>
<Div id = "div02">
<H2> display of jquery load method loading here <H2 id = "test"> the loaded text is displayed here </Div>
<Div id = "div01">
<H2> the loaded text is displayed here </Div>
<P>
<Input type = "button" value = "loading text" id = "b01"/>
</P>
Background:
Copy codeThe Code is as follows:
Public string getS (string par)
{
String content = "";
If (par. Equals ("ww "))
{
Content = "cheng gong le ";
}
Else
{
Content = "shi bai le ";
}
Return content;
}