All pastes #969137 Raw Edit

k1rby

public javascript v1 · immutable
·published 2008-04-03 14:11 UTC
rendered paste body
function link(url){	url = 'content/'+url;	openurl(url, 'main');}function openurl(url, into){	var xhr;     try {  xhr = new ActiveXObject('Msxml2.XMLHTTP');   }    catch (e)     {        try {   xhr = new ActiveXObject('Microsoft.XMLHTTP');    }        catch (e2)         {          try {  xhr = new XMLHttpRequest();     }          catch (e3) {  xhr = false;   }        }     }     xhr.onreadystatechange  = function()    {          if(xhr.readyState  == 4)         {              if(xhr.status  == 200)                  document.getElementById(into).innerHTML=xhr.responseText;              else                  document.write(xhr.status);         }    };    xhr.open("GET", url,  true);    xhr.send(null); }