answersLogoWhite

0

I'm not sure what you mean. But you can declare a function to do something as the page loads. ex: This is a page. function onload() { alert("Welcome to my page!"); } onload(); I think that will work.

User Avatar

Wiki User

15y ago

Still curious? Ask our experts.

Chat with our AI personalities

FranFran
I've made my fair share of mistakes, and if I can help you avoid a few, I'd sure like to try.
Chat with Fran
RafaRafa
There's no fun in playing it safe. Why not try something a little unhinged?
Chat with Rafa
LaoLao
The path is yours to walk; I am only here to hold up a mirror.
Chat with Lao

Add your answer:

Earn +20 pts
Q: How do you load javascript before page loads?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

Hyperlink through the javascript?

One simple way to involk a URL from within Javascript is to use the location object. For example: 1. Load a new page. <script type="text/javascript"> location.href="http://newpage.htm"; </script> 2. Add a page link to the Open Document. <script type="text/javascript"> documnet.write(location.href="http://newpage.htm"); </script>


How does javascript work?

JavaScript is what is called a Client-side Scripting Language. That means that it is a computer programming language that runs inside an Internet browser (a browser is also known as a Web client because it connects to a Web server to download pages). Inside a normal web page you place a JavaScript code inside. When the browser loads the page, the browser has a built-in interpreter that reads the JavaScript code it finds in the page and runs it. Web page designers use JavaScript in many different ways. One of the most common is to do field validation in a form. Many websites gather information from users in online forms, and JavaScript can help validate entries. For example, the programmer might validate that a person's age entered into a form falls between 1 and 120.


What is the function of the app called Noscript?

Noscript can be used when a page does not recognize Javascript, or when Javascript is not enabled. Noscript allows the information on the page to still be readable.


How do you run javascript progamming?

Javascript should run on its own. and when the page is loaded it will automaticly render on its own.


What is the difference between head tag and body tag in HTML?

Code in the head tag will be executed before that in the body, because of the order of page loading. Additionally, anything written to the body using the document.write method goes in the position of a script tag in the body