I wonder whether someone may be able to help me please.
I’ve put together this page, but I’m receiving an error that I’m not sure how to resolve.
The error I receive in firefox is ‘downloadURL is not defined’ and it highlights this line as being the problem:
downloadUrl("loadallmyfinds.php", function(data) {
This page did work correctly until I added this JS function,
(function reversegeocode() {
so it’s obvious that the problem lies within the introduction of this.
But I’ve gone through the script a number of times now, and I just can’t find the problem. I’ve checked the php script and I know that the correct information is being retrieved from the mySQL database. Having used this type of file before, I’ve also checked that the parsing of the xml is correct in terms of format etc.
I must admit to being fairly new to javscript, so perhaps my lack of knowledge is letting me down.
I just wondered though whether someone could perhaps take a look at this please and let me know what I’m doing wrong.
Many thanks
Here’s where your downloadUrl is declared:
It looks like your declaring this function inside of another scope, which means it’s not globally available, like your code assumes it is. This is likely why you’re getting the undeclared error
EDIT
I moved your downloadUrl function to the very top of the script, and you no longer get this error. Unfortunately you now get an error about doNothing being undefined.
You just need to load all this JavaScript into a JavaScript-friendly IDE (so not Visual Studio) and really untangle all these braces and parenthesis, so you can figure out where your unwanted scope is.