Busted Mug

A blog that documents solutions to the most frustrating problems that occur during development in technologies such as Java, XML, AJAX, SQL, CSS and others that make me want to throw my coffee mug against the cube wall.

Monday, January 08, 2007

XMLHttpRequest is not allowed to other domains in Firefox

XMLHttpRequest problem with Firefox and Netscape - Javascript / DHTML / Ajax

TheScripts is yet again my muse. This post is to a person who ran into exactly the same problem as I myself did my first time working with web services. The natural desire is to call a bunch of web services to mash up some resources you have available. This is all well and good until you try to get at resources not found underneath the same domain.

In order to prevent malicious web pages from telling your browser to call all manner of nasty XML resources when you load it up, the good folks at mozilla (and maybe IE now too - I'm not sure) won't let billie.com/home.html call a web service (or ajax or anything) hosted at susie.com/ws/stockticker.xml.

This keeps us secure but is WAAAAYYYY annoying if you happen to be a developer on billie.com who needs to get at that stock ticker. What you've got to do is build billie.com/ajax/tickerCaller.xml which just makes a call (on the server side of course) to susie's stock ticker and returns the XML.

It ain't pretty, but until some new fangled security comes out, that's what we're stuck with.

0 Comments:

Post a Comment

<< Home