fbjs ajax to load content

Posted by fusion on Stack Overflow See other posts from Stack Overflow or by fusion
Published on 2010-04-13T16:38:18Z Indexed on 2010/04/13 19:43 UTC
Read the original article Hit count: 793

i tried one of the examples here to load the content in the div, but apart from displaying the image, it doesn't show anything. can anyone please point out where i'm going wrong?

ajax1.js:

function General_Refresh(url,div){ 
 //Showing the load image (pay attention to /> of <img 
   document.getElementById(div).setInnerXHTML('<span id="caric"><center><img src="http://website.name/images/ajax-loader.gif" /></center></span>');
               var ajax = new Ajax(); 
                   ajax.responseType = Ajax.FBML; 

                    ajax.ondone = function(data) { 
  //Hide the loading image 
               document.getElementById('caric').setStyle('display','none'); 
               document.getElementById(div).setInnerFBML(data); 
   } 
  //If there are errors re-try 
              ajax.onerror = function() { 
               General_Refresh(url,div); 
   }     
 ajax.post(url); 
}

quote.html:

<script src="http://website.name/scripts/ajax1.js" type="text/javascript"></script> 
<script type="text/javascript">
<!--
General_Refresh("http://website.name/quote.php","quote"); 
//-->
</script>

<div id="wrapper">
<div id="quote"><strong>this</strong></div>
</div></div>

© Stack Overflow or respective owner

Related posts about fbjs

Related posts about JavaScript