简体   繁体   中英

Web Service works in IE7 but not Firefox

I have a .Net web service that I call from javascript using:

$.ajax({ type: "POST", url: "http://myServerIP/Myervice.asmx/MyMethod",
                 data: "{}",
                 contentType: "application/json; charset=utf-8",
                 dataType: "jsonp",
                 success: function(msg) { alert('sucess ' + msg); },
                 error: function(XMLHttpRequest, textStatus, errorThrown) { alert(XMLHttpRequest); alert(textStatus); alert(errorThrown); }
             });

I get a success message in IE7 and in Firefox I don't get any decent errors back just 'error' and 'undefined'

I suspect this is due to the fact that I'm on an Intranet here and IE7 is taking my credentials and passing them to IIS on 'myServer' on my behalf while other browsers cannot.

Is this the case?

How do I go about fixing this problem?

Thanks in advance

Davy

Maybe there is something going on with the datatype 'jsonp'. Read this , try using a different datatype..

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM