[jQuery] Re: Variable scope: Newbie Question

2008-12-06 Thread Mat
Wow I'm chatty aren't I... I just wanted to add I changed my code to this $(function() { $.ajax({ type: "GET", url: "xml/location.xml",

[jQuery] Re: Variable scope: Newbie Question

2008-12-06 Thread Mat
One thing I do notice with my code is that it is slow. If I change provinces and type in the city field and change provinces again things slow right down. I know this must be due to the way I have coded this. I am wondering if you have any suggestion to improve the speed of things? The form will p

[jQuery] Re: Variable scope: Newbie Question

2008-12-06 Thread Mat
Hi Micheal, Thank you so much for that. I knew I was getting close to a solution but I was well and truly stuck. It is now working and I am delighted. This is the code that worked for me success: function(xml) { towncity = []; $(xml).find("[EMAIL PROTECTED]'"+ currprov +"'] > TO

[jQuery] Re: Variable scope: Newbie Question

2008-12-05 Thread Michael Geary
Hi Mat, 1) You're defining towncity like this: var towncity = window.towncity = new Array(); That creates both a local variable named towncity and a window property (global variable) of the same name. Is that what you want? Do you need to use towncity outside this code? If not, I would chan