I have my site on index.html made in html+css., at my index.html i have this div id "content", where you put in main content to the page, and there's a link at the menubar that src to page2.php. When you press on the link it goes to the page2.php, but i want it to display inside the < div "content". In page2 i have Hello this is a test, in a echo..
Ben Yüklü çerçeveleri kullanmak istiyorum .. ben index.php benim tasarım bölmek ve sonra sayfa2.php üst dahil & olmalıdır footer? veya başka bir yolu yoktur
function test() {
var xhr = XMLHttpRequest();
xhr.onreadystatechange = function(){
if(xhr.readystate==4 && xhr.status=200)
document.getElementById('content').innerHTML = xhr.responseText;
};
xhr.open("GET", "start.php", false);
xhr.send(null);
}
<a href="start.php" onclick="test(); return false;">Hjem </a> |
<div id="content" ></div>