Cross Domain Call JQuery


/ Published in: jQuery
Save to your folder(s)

This will successfully retrieve cross domain without 302
using Complete avoids 200 statusText with "parsererror"


Copy this code and paste it in your HTML
  1. var FaxService={
  2. ServiceEndpoint:'http://localhost:19414/Service/',
  3. FaxServiceOrder:null,
  4. callService:function(serviceName,cb){
  5. $.ajax({
  6. type: "GET",
  7. url: url+serviceName,
  8. contentType: "application/json; charset=utf-8",
  9. dataType: "json",
  10. complete:cb
  11. });
  12. },
  13. getNewFaxServiceOrder:function(){
  14. FaxService.callService('GetNewFaxServiceOrder',function(data)
  15. {
  16. FaxService.FaxServiceOrder = data;
  17. });
  18. }
  19. }

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.