Nieuw lid |
|
function loadContent(url)
{
var xmlRequest = null;
if(window.XMLHttpRequest)
xmlRequest = new XMLHttpRequest();
else if (window.ActiveXObject)
xmlRequest = new ActiveXObject("Microsoft.XMLHTTP");
xmlRequest.onreadystatechange = function()
{
if(xmlRequest.readyState == 4)
{
if(xmlRequest.status == 200)
document.getElementById("div_content").innerHTML = xmlRequest.responseText;
else
alert("Error: " + xmlRequest.status);
}
}
xmlRequest.open("GET", url, true);
xmlRequest.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xmlRequest.send(null);
}
function loadContent(url) { var xmlRequest = null; if(window.XMLHttpRequest) xmlRequest = new XMLHttpRequest(); else if (window.ActiveXObject) xmlRequest = new ActiveXObject("Microsoft.XMLHTTP"); xmlRequest.onreadystatechange = function() { if(xmlRequest.readyState == 4) { if(xmlRequest.status == 200) document.getElementById("div_content").innerHTML = xmlRequest.responseText; else alert("Error: " + xmlRequest.status); } } xmlRequest.open("GET", url, true); xmlRequest.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xmlRequest.send(null); }
link maken
<a href="javascript:loadContent('url naar de pagina die je wilt laden')"> roep ajax aan</a>
<a href="javascript:loadContent('url naar de pagina die je wilt laden')"> roep ajax aan</a>
div waar de pagina in geladen word
<div id="div_content"> ... </div>
<div id="div_content"> ... </div>
this should do the trick ;)
|