Im new to the whole javascript game, I know pretty much just enough to be dangerous with no real substance. Anyway Im trying to populate a DIV with a website using the URL as an inner html source
Here is my code I keep getting an error object expecte don line 58. Which I will highlight. Anyway Not only would i Like to know what that error is about but also if my logic is correct or if I can even do what im trying... and if not what other solutions are there besides iframes.
Here is my code I keep getting an error object expecte don line 58. Which I will highlight. Anyway Not only would i Like to know what that error is about but also if my logic is correct or if I can even do what im trying... and if not what other solutions are there besides iframes.
Code:
<html>
<head>
<script langauge="text/javascript">
function reportsnagger(str)
{
xmlHttp=GetXmlHttpObject();
if (xmlHttp==null)
{
alert ("Your browser does not support AJAX!");
return;
}
var url="";
url=url++str;
xmlHttp.onreadystatechange=stateChanged;
}
function stateChanged(showcustomer.url)
{
if (xmlHttp.readyState==4)
{
document.getElementById(reportspace).innerhtml=url
}
function GetXmlHttpObject()
{
var xmlHttp=null;
try
{
// Firefox, Opera 8.0+, Safari
xmlHttp=new XMLHttpRequest();
}
catch (e)
{
// Internet Explorer
try
{
xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
}
catch (e)
{
xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
}
}
return xmlHttp;
}
</script>
</head>
<body>
<form>
Select A Report:
[B]<select name="customers" onChange="reportsnagger(this.value)">[/B] //this is line 58
<option value="">Select an option please
<option value="URL EDITED">choice1
<option value="NORTS ">choice2
<option value="WOLZA">choice3
</select>
</form><p>
<div id="reportspace"><b>Report info will be listed here.</b></div>
</p></body>
</html>
Comment