Using javascript Syntax Highlighting
<script language="Javascript">
function xmlhttpGet(strURL,tag_id) {
var xmlHttpReq = false;
var self = this;
// Mozilla/Safari
if (window.XMLHttpRequest) {
self.xmlHttpReq = new XMLHttpRequest();
}
// IE
else if (window.ActiveXObject) {
self.xmlHttpReq = new ActiveXObject("Microsoft.XMLHTTP");
}
self.xmlHttpReq.open('GET', strURL, true);
// self.xmlHttpReq.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
self.xmlHttpReq.onreadystatechange = function() {
if (self.xmlHttpReq.readyState == 4) {
if (self.xmlHttpReq.status == 200) {
updatepage(self.xmlHttpReq.responseText,tag_id);
} else {
updatepage(' [ajax error] ',tag_id);
}
}
}
self.xmlHttpReq.send(null);
}
function updatepage(str,id){
document.getElementById(id).innerHTML = str;
}
</script>
function xmlhttpGet(strURL,tag_id) {
var xmlHttpReq = false;
var self = this;
// Mozilla/Safari
if (window.XMLHttpRequest) {
self.xmlHttpReq = new XMLHttpRequest();
}
// IE
else if (window.ActiveXObject) {
self.xmlHttpReq = new ActiveXObject("Microsoft.XMLHTTP");
}
self.xmlHttpReq.open('GET', strURL, true);
// self.xmlHttpReq.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
self.xmlHttpReq.onreadystatechange = function() {
if (self.xmlHttpReq.readyState == 4) {
if (self.xmlHttpReq.status == 200) {
updatepage(self.xmlHttpReq.responseText,tag_id);
} else {
updatepage(' [ajax error] ',tag_id);
}
}
}
self.xmlHttpReq.send(null);
}
function updatepage(str,id){
document.getElementById(id).innerHTML = str;
}
</script>
Coloreado en 0.002 segundos, usando GeSHi 1.0.8.4