Okay, I have been pulling my hair out trying to figure this out.
First, here is shortened version of my script that has the same problem as the big version:
Here's the problem: The first time the page is loaded the script works fine, and sometimes even works twice, but after that it won't work again unless I open a new window and go to the page again. I can't just refresh and I can't choose anything else from the select box.
If anyone can help me with this it would be greatly appreciated.
Thanks,
Justin
First, here is shortened version of my script that has the same problem as the big version:
Code:
<html>
<head>
<title>XMLHTTP</title>
<script type="text/javascript">
function conn(){
var xmlhttp = null;
try{
xmlhttp = new ActiveXObject("Msxml2.XMLHTTP")
}catch(mse){
alert(mse.message);
try{
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP")
}catch(microsofte){
alert(microsofte.message)
xmlhttp = null;
}
}
if (!xmlhttp&&typeof XMLHttpRequest!="undefined"){
xmlhttp = new XMLHttpRequest()
}return xmlhttp
}
function showReportArea(type){
var reportArea = document.getElementById("reportArea");
var xmlhttp = conn();
var url = '[URL unfurl="true"]http://www.google.com';[/URL]
xmlhttp.open("GET",url,true);
xmlhttp.send();
xmlhttp.onreadystatechange = function(){
if (xmlhttp.readystate==4){
reportArea.innerHTML=xmlhttp.responseText;
}
}
}
</script>
<head>
<body>
<select onChange="showReportArea(this.value);">
<option value="0">Choose One</option>
<option value="1">Option 1</option>
</select>
<div id="reportArea">
</div>
</body>
</html>
Here's the problem: The first time the page is loaded the script works fine, and sometimes even works twice, but after that it won't work again unless I open a new window and go to the page again. I can't just refresh and I can't choose anything else from the select box.
If anyone can help me with this it would be greatly appreciated.
Thanks,
Justin