0
나는 html 태그를 채울 웹 서비스가 있습니다. asp.net 웹 서비스 2를 반환
[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)
}
방법 test2div 태그를 채우기 위해 웹 서비스를 코딩? 웹 서비스에서 텍스트를 반환하는 방법 예 :
string Content1 = "<div>amin</div>";
string Content2 = "<div>reza</div>;
string Content3 = Content1 + Content2;
return Content3;
자세한 설명을 도와주세요.
이 명령으로 어떻게 할 수 있습니까? var c = JSON.parse (d); –
코드 편집 후 – Trikaldarshi
처럼 다시 사용할 수 있습니다. 나는 나의 요구를 더 편집하고 설명했다. –