Apollo and Ajax/Spry (XMLHttpRequest) possible?

I decided to use any spare time during the easter holiday to learn some Apollo and Ajax (Spry) development, with the intent of combining these two technologies to make a foundation for a new and powerful UI model for web applications.

Now I did not get as much time to look at it as I hoped, but even so I already have come to a roadblock.

The following code works wonders when called from a page under the ulseth.no domain:

<script type="text/javascript" src="js/xpath.js"></script>
<script type="text/javascript" src="js/SpryData.js"></script>

<script type="text/javascript">
var dsPhotos = new Spry.Data.XMLDataSet("http://ulseth.no/spry1/photos.xml", "/gallery/photos/photo");
</script>

<ul spry:region="dsPhotos">
<li spry:repeat="dsPhotos">{dsPhotos::@path}</li>
</ul>

But when run from my local machine it generates an error:

Exception caught while loading http://ulseth.no/spry1/photos.xml: Permission denied to call method XMLHttpRequest.open

Any suggestions as to how I should/could move on would be highly appreciated.

Comments
You're running into a browser security setting. Even IE has this one... now. :)

Anyway, browsers won't allow an off-domain Javascript remote request . The reason it works from ulseth.no is because Spry is calling a file on ulseth.no. From your local machine, the domain is "Localhost", so only local files can be requested.

In retrospect, if you think about it for a second, the reasoning makes sense. But it took me an afternoon of Googling to figure it out when I first ran into that issue.

HTH
# Posted By Matt Osbun | 4/11/07 10:20 AM
Hmmm. That seems logical.

However, I wonder why I cannot access a test.ppp.com site. It doesn't like the prefix on the domain. Anyone else had this problem?
# Posted By A. J. Okie | 5/9/07 1:11 PM
Hey Trond, I'm having the same issue. I have created a small weather component using Spry to parse the National Weather Service RSS, in fact off my website http://www.federicocalvo.com/weather I had to read it thru an asp proxy page but with AIR I cannot even read it off my own website. I wonder id there is a way around this like there is with the cross domain access policy file used for flash.

Thanks, let me know if you have made any progress on this.
# Posted By Federico | 7/17/07 7:45 PM
You need to use a simple tunneling script for this.

Something like this:

<?php

/*
You can use this script to pass-through almost any rss/xml feed from an external server to another.
Just insert the url to external playlist below and copy this file to your server.
You can use the XML soure "external_feed.php" in your HTML feed this script to the spry component.
*/


// build file headers
header("content-type:text/xml;charset=utf-8");
// refer to file
readfile("http://www.YourURL/Path/To/Xml/Here");
// that's all
exit();


?>
# Posted By Tony | 9/25/07 10:56 AM