/* Its good practice in AJAX to declare all the urls you will be using at the start of the script. */ var loading="Bezig met laden..."; var http2 = getHTTPObject2(); var url = "http://www.pornokanalen.nl/test.php?id="; function handleHttpResponse2() { // 4 is the signal for finished if (http2.readyState == 4) { results = http2.responseText; leftmenu_contenttext=results; var leftmenu_content=document.getElementById( 'leftmenu_content' ); leftmenu_content.innerHTML = leftmenu_contenttext; } } function performLookup2(id) { /* Get the name, we know its >= characters */ var content = document.getElementById("leftmenu_content").value; content = id; var leftmenu_content=document.getElementById( 'leftmenu_content' ); leftmenu_content.innerHTML = '
' + loading + '
'; //Begin communication with lookup.cgi, passing in // name as a parameter http2.open("GET", url + escape(content), true); // When the state changes call our other method // handleHttpResponse http2.onreadystatechange = handleHttpResponse2; // end comms, only do this at the end of your interaction http2.send(null); } function getHTTPObject2() { var xmlhttp; /*@cc_on @if (@_jscript_version >= 5) try { xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { try { xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); } catch (E) { xmlhttp = false; } } @else xmlhttp = false; @end @*/ if (!xmlhttp && typeof XMLHttpRequest != 'undefined') { try { xmlhttp = new XMLHttpRequest(); } catch (e) { xmlhttp = false; } } return xmlhttp; }