You are here: Re: [PHP] Re: Javscript embedding problem « PHP « IT news, forums, messages
Re: [PHP] Re: Javscript embedding problem

Posted by "Satyam" on 09/19/05 10:59

It might be a timing problem. It might take longer to load the file
containing the code so that when the inline code is found and executed, the
called function is not present. Notice that all the downloads of the bits
and pieces of an HTML page proceed asynchronously and not sequentially.
You should not assume that the call to a function will be done after the
file is downloadad because it shows up later. The browser queues the
download of all the external elements in the page, code, pictures, etc while
it keeps downloading and processing the main download. They can easily get
out of synch.

The proper way to include and call javascript code is to include all code in
the <head> and then make the call in the onLoad event of the <body> tag.
This onLoad event is called when every part of the page is already loaded
and, thus, the downloaded javascript file is assured to be available.

Satyam


"Iggep" <iggep@iggepsrealm.com> wrote in message
news:432DDBED.4020201@iggepsrealm.com...
> John Taylor-Johnston wrote:
>> Try \"countdown.js\" instead of single quotes ?
>>
>>> //INCLUSION OF COUNTDOWN TIMER
>>> ."<tr><td colspan=2><SCRIPT language='JavaScript'
>>> SRC='countdown.js'></SCRIPT><center><script
>>> type='text/javascript'>countdown_clock(05, 11, 19, 08, 00,
>>> 1);</script></center></td></tr>\n"
>>> ."</table>\n"
>>
>>
>
> Tried that and it didn't work either. I changed it to SRC='countdown.js'
> after escaping the double quites didn't work. This is really bugging the
> heck out of me!

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация