<?xml version="1.0" encoding="utf-8"?>
			
			<rss version="2.0">
			<channel>
			<title>Trond Ulseth&apos;s Blog - Ajax</title>
			<link>http://trond.ulseth.no/index.cfm</link>
			<description>Trond Ulseth</description>
			<language>en-us</language>
			<pubDate>Wed, 02 Jan 2008 13:07:59 -0600</pubDate>
			<lastBuildDate>Wed, 11 Apr 2007 07:02:00 -0600</lastBuildDate>
			<generator>BlogCFC</generator>
			<docs>http://blogs.law.harvard.edu/tech/rss</docs>
			<managingEditor>trond@ulseth.no</managingEditor>
			<webMaster>trond@ulseth.no</webMaster>
			
			
			
			
			
			<item>
				<title>Apollo and Ajax/Spry (XMLHttpRequest) possible?</title>
				<link>http://trond.ulseth.no/index.cfm/2007/4/11/Apollo-and-AjaxSpry-XMLHttpRequest-possible</link>
				<description>
				
				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:

&lt;code&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;js/xpath.js&quot;&gt;&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;js/SpryData.js&quot;&gt;&lt;/script&gt;

&lt;script type=&quot;text/javascript&quot;&gt;
var dsPhotos = new Spry.Data.XMLDataSet(&quot;http://ulseth.no/spry1/photos.xml&quot;, &quot;/gallery/photos/photo&quot;);
&lt;/script&gt;

&lt;ul spry:region=&quot;dsPhotos&quot;&gt;
&lt;li spry:repeat=&quot;dsPhotos&quot;&gt;{dsPhotos::@path}&lt;/li&gt;
&lt;/ul&gt;
&lt;/code&gt;

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

&lt;span style=&quot;color:#FF0000;&quot;&gt;Exception caught while loading http://ulseth.no/spry1/photos.xml: Permission denied to call method XMLHttpRequest.open&lt;/span&gt;

Any suggestions as to how I should/could move on would be highly appreciated.
				
				</description>
				
				<category>Apollo</category>
				
				<category>Ajax</category>
				
				<pubDate>Wed, 11 Apr 2007 07:02:00 -0600</pubDate>
				<guid>http://trond.ulseth.no/index.cfm/2007/4/11/Apollo-and-AjaxSpry-XMLHttpRequest-possible</guid>
				
			</item>
			
		 	
			</channel></rss>
<SCRIPT language="Javascript">
<!--

// FILE ARCHIVED ON 20080102190808 AND RETRIEVED FROM THE
// INTERNET ARCHIVE ON 20100801044725.
// JAVASCRIPT APPENDED BY WAYBACK MACHINE, COPYRIGHT INTERNET ARCHIVE.
// ALL OTHER CONTENT MAY ALSO BE PROTECTED BY COPYRIGHT (17 U.S.C.
// SECTION 108(a)(3)).

   var sWayBackCGI = "http://web.archive.org/web/20080102190808/";

   function xResolveUrl(url) {
      var image = new Image();
      image.src = url;
      return image.src;
   }
   function xLateUrl(aCollection, sProp) {
      var i = 0;
      for(i = 0; i < aCollection.length; i++) {
         var url = aCollection[i][sProp];         if (typeof(url) == "string") { 
          if (url.indexOf("mailto:") == -1 &&
             url.indexOf("javascript:") == -1
             && url.length > 0) {
            if(url.indexOf("http") != 0) {
                url = xResolveUrl(url);
            }
            url = url.replace('.wstub.archive.org','');
            aCollection[i][sProp] = sWayBackCGI + url;
         }
         }
      }
   }

   xLateUrl(document.getElementsByTagName("IMG"),"src");
   xLateUrl(document.getElementsByTagName("A"),"href");
   xLateUrl(document.getElementsByTagName("AREA"),"href");
   xLateUrl(document.getElementsByTagName("OBJECT"),"codebase");
   xLateUrl(document.getElementsByTagName("OBJECT"),"data");
   xLateUrl(document.getElementsByTagName("APPLET"),"codebase");
   xLateUrl(document.getElementsByTagName("APPLET"),"archive");
   xLateUrl(document.getElementsByTagName("EMBED"),"src");
   xLateUrl(document.getElementsByTagName("BODY"),"background");
   xLateUrl(document.getElementsByTagName("TD"),"background");
   xLateUrl(document.getElementsByTagName("INPUT"),"src");
   var forms = document.getElementsByTagName("FORM");
   if (forms) {
       var j = 0;
       for (j = 0; j < forms.length; j++) {
              f = forms[j];
              if (typeof(f.action)  == "string") {
                 if(typeof(f.method)  == "string") {
                     if(typeof(f.method) != "post") {
                        f.action = sWayBackCGI + f.action;
                     }
                  }
              }
        }
    }


//-->
</SCRIPT>

