0
我有一個web服務來填充html標記。與2返回的asp.net web服務
[WebMethod]
public string GetHelloMessage(string country)
{
string test = "<div>amin</div>";
return test;
}
和jQuery是:
url: ServiceUrl,
type: "POST",
contentType: "application/json; charset=utf-8",
dataType: "jsonp",
timeout: 15000,
success: function (d) {
if (d.length > 0) {
var c = JSON.parse(d);
if ($(".test1div").length) {
$(".test1div").html(c.Content1)
}if ($(".test2div").length) {
$(".test2div").html(c.Content2)
}
如何編寫Web服務,以填補test2div標籤?如何添加以從Web服務返回文本?例如:
string Content1 = "<div>amin</div>";
string Content2 = "<div>reza</div>;
string Content3 = Content1 + Content2;
return Content3;
請幫我解釋一下。
這怎麼可以用這個命令:var c = JSON.parse(d); –
您可以使用您編碼的編碼,因爲您是 – Trikaldarshi
請再讀一遍我的問題。我已經編輯並更多地解釋了我的請求。 –