All pastes #249062 Raw Edit

Trucs

public javascript v1 · immutable
#249062 ·published 2006-11-15 11:04 UTC
rendered paste body
<script type="text/javascript">			// <![CDATA[			function getXMLHTTP(){				try{					xmlhttp=new XMLHttpRequest();					if(xmlhttp.overrideMimeType){     						xmlhttp.overrideMimeType("text/xml");   					}				}				catch(a){					try{xmlhttp=new ActiveXObject("Msxml2.XMLHTTP");}					catch(b){						try{xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");}						catch(c){xmlhttp=false;}					}       		 		}  				return xmlhttp;			} 			function sendData(method,url,data){    				var xmlhttp=getXMLHTTP();    				if(!xmlhttp){        				return false;    				}    				else{    					xmlhttp.onreadystatechange=function(){    	   					if(xmlhttp.readyState==4 && xmlhttp.status==200){document.getElementById("content").innerHTML=xmlhttp.responseXML.getElementById("content").firstChild.data;document.getElementById("menu").innerHTML=xmlhttp.responseXML.getElementById("menu").firstChild.data;			}     					}  				}    				if(method=="HEAD" || method=="GET"){					xmlhttp.open(method,url,true);					xmlhttp.send(null);    				}     				else if(method=="POST"){        				xmlhttp.open(method,url,true);        				xmlhttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded");     					xmlhttp.send(data);     				}    				return true; 			} 			// ]]> 			</script>