Pops escribió:
SeVir,

Just a small note, this is cool for trusted requests which you
initiate.

But IE 6.0 and Opera 9.10 doesn't like it.

Should it work under IE and Opera?

I explain this technique in my "Web Services with JavaScript" course. Tested in:
Firefox 1.0 + (Win & Lin)
IE 5.5, 6 & 7
Opera 9+
Safari 3 (win)
Konqueror 3.5 (Lin)

In fact, I said, internally Google API (Maps, Finances, ...) use the same method, you can
see that using Firebug in Google Maps ;-)
--
HLS

On Aug 24, 8:16 am, SeViR <[EMAIL PROTECTED]> wrote:
[EMAIL PROTECTED] escribió:> I'm trying to get a json object from a sub-domain 
but keep getting a
$.ajax is not cross-side domain, because XMLHttpRequest is not
cross-side domain.
You can use jsonp with:

var script_call = document.createElement("script");
script_call.type = "text/javascript";
script_call.src = "http://sub.domain.tld/data?callback=mycallback";;
$("head")[0].appendChild(script_call);

function mycallback(data){
    alert(data);  //example

}

JSON RESPONSE IS:
mycallback(
    {
       jsondata: "somthing",
       another: "ey"
    }
);

Works for me, using Yahoo Services, Flickr, Amazon, .... Google API use
internally
the same.

--
Best Regards,
 José Francisco Rives Lirola <sevir1ATgmail.com>

 SeViR CW · Computer Design
 http://www.sevir.org

 Murcia - Spain




--
Best Regards,
José Francisco Rives Lirola <sevir1ATgmail.com>

SeViR CW · Computer Design
http://www.sevir.org
Murcia - Spain

Reply via email to