English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

Does anyone know how I can say ONLOAD="" without putting it in the body tag, pref. using a JavaScript...

2006-08-17 05:00:52 · 7 answers · asked by sneak_chamber 2 in Computers & Internet Programming & Design

7 answers

document.body.onload = functionName;

Remember functionName without the (). functionName() calls the function, while functionName is just a reference to a function.

2006-08-17 05:07:14 · answer #1 · answered by Isofarro 3 · 0 1

always put the scripts in the head.

onload is normally set on the body tag... but

depending what you need to do in there, you can just slip a little call to your code at the bottom of your body.

While putting a script after the body may work with some browsers, it is not going to work with standards based browsers, that do not support a "dumb down" mode.

If your js needs to nav the dom, wait until body is loaded. Just set the body.onload after the body has started .... anywhere in the body. and do your work in the function that you set the body.onload to.

2006-08-20 09:24:42 · answer #2 · answered by jake cigar™ is retired 7 · 0 0

the factor approximately having a physique is that ninety% of our time is taken up being concerned and offering for the physique: housing, food, clothing, etc. This leaves a smaller component to our lives to confirm to religious pastimes. So, it extremely is a project and consider out of our mettle (and temptations) to stay on the actual airplane, in a physique. A soul on the metaphysical airplane can spend a hundred% of its time and efforts focussing on religious pastimes and embellishing religious enhance. maximum souls have inhabited bodies; some that are spirit classes or instructors have and a few have not; and a few who've found out maximum earthly training do no longer could return decrease back anymore. The physique is in elementary terms a shell for the soul on the actual airplane.. a motor vehicle in the international.

2016-12-17 12:30:18 · answer #3 · answered by ? 4 · 0 0

the onload works with the Body tag...

however, if you want to the JavaScript to be executed when it is fully loaded without using on load...

e.g.



...

...


2006-08-17 05:08:05 · answer #4 · answered by shin 3 · 0 0

Put the script after the closing body tag:

2006-08-17 08:48:42 · answer #5 · answered by Anonymous · 0 1

Just put the javascript into the section, or anywhere inside (less clean, less recommended).
For example:



alert('hello');



2006-08-17 05:06:24 · answer #6 · answered by Alex 2 · 0 1

you can also include it like this:

2006-08-17 05:11:58 · answer #7 · answered by John J 6 · 0 0

fedest.com, questions and answers