FBJS and AJAX

Discussion in 'JavaScript' started by grutland, Apr 19, 2010.

  1. #1
    My company has recently decided to move towards developing for Facebook and looking to include a RSS feed on a FBML page within a Fan Page.
    Now it looks like FB have their own version of JS running called FBJS and I'm trying to start simple by just importing a text file from our server using AJAX and printing out the result.

    I keep getting a 404 error though.
    Does any one have any idea why?

    This is the code I am using...

    <script type="text/javascript">
    <!--
    function General_Refresh(url,div){  
    	document.getElementById(div).setTextValue("Loading " + url + "..."); 
    	var ajax = new Ajax(); 
    	ajax.responseType = Ajax.RAW;
    	ajax.ondone = function(data) { 
    		document.getElementById(div).setTextValue(data); 
    	} 
    	
    	ajax.onerror = function(e) { 
    		document.getElementById(div).setTextValue("Error");
    	} 
    	
    	ajax.post(url);
    }
    //--> 
    </script>
    <div id="mydiv"></div>
    <a onclick='General_Refresh("http://www.instarentals.com/robots.txt","mydiv");'>Load content</a>
    Code (markup):
     
    grutland, Apr 19, 2010 IP
  2. grutland

    grutland Active Member

    Messages:
    86
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    71
    #2
    Sorry, I answered my own question.
    Cross domain communication.
     
    grutland, Apr 19, 2010 IP