介面: 複製程式碼 程式碼如下: <BR>$() .ready(function () { <BR>$("#b01").click(function () { <BR>htmlobj = $.ajax({ url: "/Content/upFile/測試.txt", async: false }); <BR>$("#div01").html(htmlobj.responseText); <BR>}); <BR>}); <br><br>$(document).ready(function () { <BR>$("#test").load("/Content/upFile/測試2.txt #p1", function (responseTxt, statusTxt, xhr) { <BR>if (statusTxt == "success") <BR>alert("外部內容載入成功!" xhr); <BR>if (statusTxt == "error") <BR>alert("Error: " xhr.status ": " xhr.statusText); <BR>}) ; <BR>}); <br><br>$(document).ready(function () { <BR>$("#getbutton").click(function () { <BR>$.get("/ DownSet/index", function (data, status) { <BR>alert("資料:" data "n狀態:" status); <BR>}); <BR>}); <BR>}); <br><br>$(document).ready(function () { <BR>$("#postbutton").click(function () { <BR>$.get("/CustomerInformation/getS", { par: " ww" }, function (data, status) { <BR>alert("資料:" data "n狀態:" status); <BR>$("#postText").html(data); <BR>}) ; <BR>}); <BR>}); <br><br> post方法載入文字後會在此顯示 get方法載入文字後會在這裡顯示 jquery load方法載入的顯示在這裡 載入文字後會在這裡顯示 載入文字後會在這裡顯示 後台: 複製程式碼 程式碼如下: public string getS(string parstring) { string content = ""; if (par.Equals("ww")) { content = "cheng gong le"; } else { content = "shi bai le"; } return content; }