FINALLY! SOME UPDATES! This website is being reconstructed. Some content will go away soon. If you want to see my new stuff, visit my github: https://github.com/jrcharney/.

March 4, 2012

So much to do, so little time

From your view, the source.js file needs work. When I origninally wrote it in 2006, jQuery hadn't been published yet. So what used to look like this...

var XMLHttpRequestObject = false;

if(window.XMLHttpRequest){XMLHttpRequestObject = new XMLHttpRequest();}

function getData(dataSrc,divID)
{
 if(XMLHttpRequestObject){
  XMLHttpRequestObject.open("GET",dataSrc);
  XMLHttpRequestObject.onreadystatechange = function(){
   if(XMLHttpRequestObject.readyState == 4 && XMLHttpRequestObject.status == 200){
    displayText(divID,XMLHttpRequestObject.responseText);
   };
  };
  XMLHttpRequestObject.send(null);
 };
};

function displayText(divID,text)
{
 var obj = document.getElementById(divID);
 obj.innerHTML = text;
};

...is now this.

function getData(dataSrc,divID){
 $(divID).load(dataSrc,function(){
  $(this).text();
 });
};

The good news is that jQuery does wipe out a lot of JavaScript code to make an AJAX operation work. The bad news is that the results are the same. Thus, my post from last week is incomplete until I figure out why << stops processing after the second <. Substituting all &, < and > characters with &amp;, &lt;, and &gt; respectively did not resolve this issue. Thus this tells me that if I want to fix this problem, I need to fix it before jQuery fetches it.

Tags

Under Construction