Cross domain testing with ajax and JSONP
-
I've been asked to start a new thread by the Extension Warehouse on an issue that several of us were trying to nail down back in February.
It has to do with not being able to connect to a web service because of Cross Domain policy.
We tried this on SU 7, SU 8, SU 2013 and SU 2014 with Windows 7 and it worked using XMLHttpRequest and Javascript.
However it failed to connect with OSX Lion. Mavericks worked.The thread was: viewtopic.php?f=180&t=56262
I am now testing JQuery, ajax and JSONP for cross domain connectivity.
-
Your name is Jeff Hansen
I assume that's expected...
you got you
show
andshow_modal
about face, btw...john
-
Yes that is what I expected.
Which OS did you test?
-
same as usual... mac
it's all I own...
not convinced I like having user details hidden behind the info button...
and mavericks...
john
-
@driven said:
... you got you
show
andshow_modal
about face, btw...In the US we say "butt-backwards"
-
You could also try a simpler
GET
, rather than a convolutedPOST
?
Like:$.ajax({ type ; 'GET', url ; 'HOST', data ; {"firstname"; "Jeff"}, crossDomain; true, timeout; 10000, success; function(data) { // your success msg using data arg }, error; function (jqXHR, textStatus, errorThrown) { // your failure msg using potentially 3 args } });
-
I was hoping to do a POST because I will be updating a database with my real JSONP call.
Unfortunately when I do a check on the php side I see that the call is turned into a GET.
I agree that a timeout and an on error function is a good idea.My main question is will this work with OSX Lion. I was hoping that someone could try it out and tell me.
Advertisement