Hvorfor starter dette javascript ikke vitester(); når indholdet af test.php er loadet?
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
<script type="text/JavaScript">
function change(file, variabel, func, way) {
xmlHttp = GetXmlHttpObject();
if (xmlHttp == null) {
alert ("Du kan desværre ikke bruge kommentar systemet, fordi din browser ikke understøttet 'HTTP Request'.");
return;
}
var url = file + variabel;
xmlHttp.onreadystatechange = stateChanged(func);
xmlHttp.open(way, url, true);
xmlHttp.send(null);
}
function stateChanged(func) {
if(xmlHttp.readyState == 4 || xmlHttp.readyState == 'complete') {
eval(func)();
}
}
function GetXmlHttpObject() {
var objXMLHttp = null;
if (window.XMLHttpRequest) {
objXMLHttp = new XMLHttpRequest();
} else if (window.ActiveXObject) {
objXMLHttp = new ActiveXObject("Microsoft.XMLHTTP");
}
return objXMLHttp;
}
function vitester() {
alert("asdasdasd sad asd s");
}
connect('test.php','?asd=asfdggrd','vitester', 'GET');
</script>
</head>
<body>
</body>
</html>
Indlæg senest redigeret d. 10.01.2007 17:56 af Bruger #10725