i need send data through jsonp response mvc application. jsonp response method used jsonpfilter.
this jsonp response method:
[jsonpfilter] public jsonresult getpagename() { return new jsonresult { data = session["page"], jsonrequestbehavior = jsonrequestbehavior.allowget }; }
and javascript function:
$.ajax({ type: "get", datatype: "jsonp", url: 'http://localhost:54845/login/getpagename', contenttype: "application/json; charset=utf-8", success: function (data) { alert(data.width + "-" + data.height); } });
this code works great on ff. in ie nothing happening.
what wrong in code? thank you.
are planning on making cross-domain http gets of json data? if not, why bother jsonp? use json.
Comments
Post a Comment