Sign In| Join
Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Jan 22, 2013 03:32 PM by richmiller
Member
48 Points
66 Posts
Jan 20, 2013 06:13 PM|LINK
Hi guys
I have a Web API project in my solution and I have a separate MVC project that calls the Web Api via an Ajax call.
There is something very strange happening - it only works in IE 10?
Does anyone know what the problem may be?
Here is my Javascript code:
$.ajax({ url:"http://localhost:49840/api/profile", type: "GET", contentType: "jsonp", success: function (result) { $.map(result, function (item) { self.Profiles.push(new Profile(item)) }); alert('Hello Web Man T'); } });
It is using Knockout however, this shouldn't matter as all it's doing is adding it into an Array of Profile.
I appreciate any comments. I am completely and utterly confused.
Thanks
Mark
730 Points
237 Posts
Jan 21, 2013 01:01 PM|LINK
A quick search landed me this: http://stackoverflow.com/questions/8364037/jsonp-java-servlets-and-internet-explorer. I am not sure if it will help. Hopefully someone with more experience using JSONP can help.
40 Points
51 Posts
Jan 22, 2013 03:32 PM|LINK
Try putting this statement in ahead of your ajax call:
jQuery.support.cors = true;
mhbrown
Member
48 Points
66 Posts
Ajax call to Web Api only works in IE10???
Jan 20, 2013 06:13 PM|LINK
Hi guys
I have a Web API project in my solution and I have a separate MVC project that calls the Web Api via an Ajax call.
There is something very strange happening - it only works in IE 10?
Does anyone know what the problem may be?
Here is my Javascript code:
$.ajax({ url:"http://localhost:49840/api/profile", type: "GET", contentType: "jsonp", success: function (result) { $.map(result, function (item) { self.Profiles.push(new Profile(item)) }); alert('Hello Web Man T'); } });It is using Knockout however, this shouldn't matter as all it's doing is adding it into an Array of Profile.
I appreciate any comments. I am completely and utterly confused.
Thanks
Mark
panesofglass
Member
730 Points
237 Posts
Re: Ajax call to Web Api only works in IE10???
Jan 21, 2013 01:01 PM|LINK
A quick search landed me this: http://stackoverflow.com/questions/8364037/jsonp-java-servlets-and-internet-explorer. I am not sure if it will help. Hopefully someone with more experience using JSONP can help.
richmiller
Member
40 Points
51 Posts
Re: Ajax call to Web Api only works in IE10???
Jan 22, 2013 03:32 PM|LINK
Try putting this statement in ahead of your ajax call: