When I try to run the following script, I get the following error:
[quote]
Error: fileSearch is not a function
Source File: [url]http://localhost:8081/file:/C:/Documents%20and%20Settings/test/My%20Documents/My%20Web%20Sites/home/file/docupload.php?DBGSESSID=-1&PHPEdHidden=23258
Line: 1
The function is included in an external javascript page, and every other function on that page works properly. This one however always returns that error, even if I comment out the entire function and just create put in an “alert”.
The function:
[code=php]
function fileSearch() { /*
var form = document.fileform;
var resultTable = document.getElementById(“linkSearchResults”);
var fileId = form.id.value;
var qry = “searchMethod=id&userQuery=” +fileId+ “&time=” +time;
xmlHttpOpen();
ajaxRequest.onreadystatechange = function() {
if (ajaxRequest.readyState == 1) {
resultTable.innerHTML = “<tr><td colspan=’2′>Searching…</td></tr>”;
}
if (ajaxRequest.readyState == 4) {
resultTable.innerHTML = ajaxRequest.responseText;
}
}
ajaxRequest.open(“POST”, “fileSearch.php”, true);
ajaxRequest.setRequestHeader(“Content-Type”,”application/x-www-form-urlencoded; charset=UTF-8″);
ajaxRequest.send(qry); */
alert(“Is a function”);
}
And how I call it:
[code=html]
<input type=”button” class=”gloss” value=”Search” name=”search” onclick=”fileSearch()”>
I think I’m having a case of the mondays.