-1
我的想法是創建一個函數,它返回休息服務時的呼叫值。從內部功能客戶端restful jQuery不起作用
代碼:
.....
var dddd;
$.ajax({
type: "GET",
url: "http://localhost:8084/GetSomeRest/asdf/ddd/arbol/1",
contentType: "application/json; charset=utf-8",
dataType: "json",
async: "false", // with this line add solved
success: function (dataaa) {
// do something
dddd= dataaa.name;
alert(dddd);// here has value
}});
alertt(dddd); //here is null
.....
問題是什麼?歡迎任何幫助。
可能重複[如何返回從AJAX響應調用?](http://stackoverflow.com/questions/14220321/how-to-return-the-an-ajax-call) –