Javascript includes not recognised - the sequel

M

Martin Walke

Hi guys,

For those who responded before here's an update from hell!!!

I think I confused people before when I said on the 'page load' and Chris
suggested using the body onload. I was using the onLoad of the body tag
anyway to start my JS function.

Anyway, I changed the order of my includes such that the one that calls all
the rest was loaded last and that worked.....or so I thought.

Then it suddenly stopped working. I'd given all my includes IDs so I used a
while loop to make sure that the includes had fully loaded. I assume that's
right? If the ID is null then the object hasn't fully loaded?

Well, it passed the loops OK but the very next line was the call to one of
the nested calls which then failed! So the includes were loaded successfully
but not the functions???? How does that work then?

I couldn't find any way of determining whether a function was defined so I
simply recreated the function as a dummy function and lo and behold the
bl**dy thing worked! I added the meat to the function and it also worked. I
copied the code from the existing include to a new file, renamed it to the
correct name and run the page and ....... it worked!! There was another
instance of the page not working with a different nested function so I
repeated the exercise and ...... it worked.

So now I'm lost. Everything works exactly as it should do but it worries me
that the correcting action doesn't make sense. I've compared the newly
created file with the old non-working one both alphabetically and binary
wise and there is no difference.

Any ideas at this stage are purely academic but it would be interesting to
know why - and know what to prevent/check for in the future especially once
it's loaded at the client's! ;-)

Martin
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,020
Latest member
GenesisGai

Latest Threads

Top