Click to See Complete Forum and Search --> : onload event


role
07-16-2003, 12:03 PM
how to override onload event in this case:

<body onload="short_script_just_used_by_this_page;common_long_script_in_all_my_pages">

i want the common long script in external javascript so it will be like this

<script src="externalonload.js"></script>

<body onload="short_script_just_used_by_this_page">

thanxx a lot

Khalid Ali
07-16-2003, 12:34 PM
just put the common code in the external .js file andimport it as you have

<script src="externalonload.js"></script>

and you should be set

role
07-17-2003, 02:04 AM
onload in external script not called...

this is the external script:

(file externalonload.js)
<!--
onload=function() { common_long_sc
ript_in_all_my_pages() }
// -->

Charles
07-17-2003, 05:27 AM
We went through this once before. See http://forums.webdeveloper.com/showthread.php?s=&threadid=12929.

role
07-17-2003, 12:19 PM
upss :)
yeah, but still don't know the answer :confused:
you say the solution will be like this:


onload = function () {doSomething(); doSomethingElse()}
or
<body onload="doSomething(); doSomethingElse()">

but i want the script call the common-long-javascript

like this:

<script src="common_long.js"></script>
<body onload="page_javascript()">

no way i can do this??

thanxx