Code: Select all
<html>
<body>
<span id="header"></span>
<script type="text/javascript">
xmlhttp=null;
if (window.XMLHttpRequest){
// code for Firefox, Mozilla, IE7, etc.
xmlhttp=new XMLHttpRequest();
}
else if (window.ActiveXObject){
// code for IE6, IE5
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
if (xmlhttp!=null){
xmlhttp.onreadystatechange = function(){
if(xmlhttp.readyState == 4){
x=xmlhttp.responseText;
document.getElementById("header").innerHTML=x;
}
}
xmlhttp.open("GET", "YourFile.php", true);
xmlhttp.send(null);
}
else{
alert("Your browser does not support XMLHTTP.");
}
</script>
</body>
</html>