function getThisFrame(frameId) {
var r;
$.ajax({
type: \"POST\",
contentType: \"application/json\",
url: \"abcdefg.asmx/RetriveThis
you are returning result.d
to $.ajax()
not to getThisFrame()
.
You need somekind of callback if you want to handle result.d
somehow.
function getThisFrame(frameId, callback) {
var r;
$.ajax({
type: "POST",
contentType: "application/json",
url: "abcdefg.asmx/RetriveThis",
data: "{Id:" + Id + "}",
dataType: 'json',
success: function (result) {
if(typeof callback === 'function') callback.apply(this, [result.d]);
}
});
}
getThisFrame(5, function(data){
// do something with data.
});