HighDots Forums  

include problem.

JavaScript discussion (multi-lingual) JavaScript discussion (alt.comp.lang.javascript)


Discuss include problem. in the JavaScript discussion (multi-lingual) forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Marcel
 
Posts: n/a

Default include problem. - 10-06-2007 , 04:15 PM






Hi,

i use the following code in the 'head' to inlcude some functions:
<script language="javascript" type="text/javascript"
src="javascript/toolbox.js"></script>

and in the body i start one of those functions like this:
<body onload="changefoto();">

But this does not work. When i put the code directly in my html page it
works just fine.

Who can help me?

Thanks in advance
Marcel



Reply With Quote
  #2  
Old   
spambuster@omar-inexile.com
 
Posts: n/a

Default Re: include problem. - 10-09-2007 , 05:56 AM






On Sat, 6 Oct 2007 23:15:43 +0200, "Marcel" <marcelturtle (AT) planet (DOT) nl>
wrote:

Quote:
Hi,

i use the following code in the 'head' to inlcude some functions:
script language="javascript" type="text/javascript"
src="javascript/toolbox.js"></script

and in the body i start one of those functions like this:
body onload="changefoto();"

But this does not work. When i put the code directly in my html page it
works just fine.

Who can help me?

Thanks in advance
Marcel

Post your script so we can look at it. Are you putting the
<script></script> tags in the .js file? You shouldn't.


Reply With Quote
  #3  
Old   
Andreas M.
 
Posts: n/a

Default Re: include problem. - 10-14-2007 , 04:34 PM



Am 06.10.2007 23:15 Marcel wrote

Quote:
i use the following code in the 'head' to inlcude some functions:
script language="javascript" type="text/javascript"
src="javascript/toolbox.js"></script

and in the body i start one of those functions like this:
body onload="changefoto();"

But this does not work. When i put the code directly in my html page it
works just fine.
Not sure. I never use 'body' with 'onload'. Try this:

From http://dean.edwards.name/weblog/2005/09/busted/
------------------------------------------------------------------------
First, let me define the problem. The window.onload event is used by
programmers to kick-start their web applications. This could be
something trivial like animating a menu or something complex like
initialising a mail application. The problem is that the onload event
fires after all page content has loaded (including images and other
binary content). If your page includes lots of images then you may see a
noticeable lag before the page becomes active. What we want is a way to
determine when the DOM has fully loaded without waiting for all those
pesky images to load also.
-------------------------------------------------------------------------

So, if you want to display images only, window.onload() should suffice.
If you want to manipulate the DOM, then it may not be the perfect
solution and a toolkit like jQuery [http://jquery.com] may be a good
choice anyway.

Make sure to read also:
http://dean.edwards.name/weblog/2006/06/again/

--
Greets, Andreas M.


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.