смотрел пример и пытался написать скрипт .
вроде написал но он не работает
консоль выдает: Uncaught SyntaxError: Unexpected token )
var xmlHttp;
function createxmlHttp(){
try {
xmlHttp=new XMLHttpRequest();
}
catch(e){
//IE
try{
xmlHttp=new ActiveXObject("Msxm12.XMLHTTP");
}
catch(e){
xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
}
}
}
function connect(url){
createxmlHttp();
xmlHttp.open("GET",url,true);
xmlHttp.onreadystatechange=funcChange;
xmlHttp.send(null);
}
function funcChange(){
if(xmlHttp.readyState==4 && xmlHttp.status==200)alert(xmlHttp.responseText);
else alert("ошибка запроса");
}
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Документ без названия</title>
<script type="text/javascript" src="js/ajaxPage.js" ></script>
</head>
<body>
<input type="button" onClick="connect(test.php?page=1);" value="1" /><br/>
<input type="button" onClick="connect(test.php?page=2);" value="2" /><br/>
<input type="button" onClick="connect(test.php?page=3);" value="3" /><br/>
<input type="button" onClick="connect(test.php?page=4);" value="4" /><br/>
<input type="button" onClick="connect(test.php?page=5);" value="5" /><br/>
<?php
if(isset($page)){
$page=$_GET['page'];
echo $page;
}
?>
<br><br><br>
<textarea style="width:200px; height:200px;" ></textarea>
</body>
</html>