Jonathan Perry-Houts

Navigation

Skip navigation.

Search

Site navigation

Email conversation

FromJonathan Perry-Houts
ToMe
Subjectquick question about importXML.js
Date3 July 2008 16:44
I'm working on a dynamic webform for one of the departments at my school and was
having problems getting Safari to play well with my code. Your script helped a
lot but I'm just having one problem. I don't think it's a problem with your
script as much as a general quetion about Javascript

When I run it, the drop down box that it creates is the only thing on the page
(it leaves out the rest of the static text from the html file) and the page is
continuously loading. - In Safari, the page appears to finish loading but the
rest of the html is still gone.

It seems to have to do with the "var MWJ_ldD = [];" declaration at the
beginning. If I remove that (obviously the script doesn't work) but it runs
(and I can insert "hello worlds" in there and they run) and it has no problem
displaying the rest of the html.

Why would variables that are outside of functions cause behavior like that?

**So far I have tested it in Firefox and Safari

Thanks so much for your help, your website is really great!

--Jonathan
FromMe
ToJonathan Perry-Houts
SubjectRe: quick question about importXML.js
Date5 July 2008 11:34
Jonathan,

> So far I have tested it in Firefox and Safari

Please follow these guidelines. That should put me in a better position
to help:
http://www.howtocreate.co.uk/sendEmail.php#testbrowsers

> and the page is continuously loading

Happens in Firefox if you use document.write after the page has loaded
(you don't want to do that) but forget to use document.close(). Using
document.write after the page has loaded will erase whatever was already
displayed, which would cause the page to seem to disappear, so I am
guessing this is what you have done.

> It seems to have to do with the "var MWJ_ldD = [];" declaration at the
> beginning. If I remove that (obviously the script doesn't work) but it
> runs

Well sure, if you break my script it will throw errors, and any
remaining script (probably the part that is incorrectly using
document.write) will not run - hence the response will be completely
different. Put my script back as it should be before testing in Opera.

If the suggestion about document.write does not give you enough
information to fix it, I will need a publicly available URL where I can
see it for myself in order to debug it.


Mark 'Tarquin' Wilton-Jones - author of http://www.howtocreate.co.uk/
FromJonathan Perry-Houts
ToMe
SubjectRe: quick question about importXML.js
Date15 July 2008 18:31
Thanks! That helped a lot.

Nice website by the way, I really appreciate it.
This site was created by Mark "Tarquin" Wilton-Jones.
Don't click this link unless you want to be banned from our site.