jQuery ajax - blank response returned -
i trying use jquery ajax values database , return them in array.
i have used same code several times before time, no response being returned. although post values correct values expect. here javascript code using:
$.ajax({ url: '/blogarchive.asmx/changepost' , type: 'post' , contenttype: 'application/json; charset=utf-8' , data: '{filename:"' + filename + '"}' , datatype: 'json' , success: function (data) { var arraylist = data.d; var blogposttitle = $(".blogposttitle")[0]; var blogpostdate = $(".blogpostdate")[0]; var blogpostcontent = $(".blogpostcontent")[0]; $(blogposttitle).html(arraylist[0]); $(blogpostdate).html(arraylist[1]); $(blogpostcontent).html(arraylist[2]); } // , error: function (xmlhttprequest, textstatus, errorthrown) // { // //there error // alert('dfd'); // } });
the javascript error receiving data null, expect response blank.
it seems name of web method calling javascript not being read, because if changed 'changepost' 'changepost1' example, still returns blank response, although expect error message saying web method can't found.
it seems recognise blogarchive.asmx web service exists because if put create error in vb code, error appears response.
i sure must simple doing wrong. appreciated.
, data: '{filename:"' + filename + '"}'
seems odd. meant:
, data: {filename: filename}
(or 'filename=' + filename
)
furthermore, did inspect request (and response) via firebug or similar?
Comments
Post a Comment