if (window.XMLHttpRequest){// code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp=new XMLHttpRequest();
}
else{// code for IE6, IE5
// xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
try{
xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); // IE 5
} catch (e) {
try {
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); // IE 6
} catch (e) {
alert("...your error message here...");
return false;
}
}
}
var rpag = "anypage.php?param1=somveval";
xmlhttp.open("GET",rpag,true);
xmlhttp.send();
xmlhttp.onreadystatechange=function(){
if (xmlhttp.readyState==4 && xmlhttp.status==200){
xmlDoc=xmlhttp.responseText;
xmlhttp.abort();
}
}
var rpag = "anypage.php?param1=somveval";
var rpag = "anypage.php?param1=1";
1) var rpag = "anypage.php?param1=2";
var rpag = "anypage.php?param1=1";
var rpag = "anypage.php?param1=somveval&extra="+Math.random();
<html>
<head>
<script type="text/javascript">
if (window.XMLHttpRequest){// code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp=new XMLHttpRequest();
}
else{// code for IE6, IE5
// xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
try{
xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); // IE 5
} catch (e) {
try {
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); // IE 6
} catch (e) {
alert("...your error message here...");
return false;
}
}
}
var extraval = document.getElementById('inc').value; //Read value of hidden field.
extraval = extraval + 1; // increment of 1.
document.getElementById('inc').value = extraval; //updating value of hidden field so //that next time it is incremented value
var rpag = "anypage.php?param1=somveval&extra="+extraval;
xmlhttp.open("GET",rpag,true);
xmlhttp.send();
xmlhttp.onreadystatechange=function(){
if (xmlhttp.readyState==4 && xmlhttp.status==200){
xmlDoc=xmlhttp.responseText;
xmlhttp.abort();
}
}
</script>
</head>
<body>
<input type=hidden id="inc" value = "0"/>
</body>
Have a question about something in this article? You can receive help directly from the article author. Sign up for a free trial to get started.
Comments (1)
Author
Commented:regards,
aqid