2

How to call javascript function at the end of loading page ? I add at the end of page, but is there any other way ?

3 Answers 3

5

Use onload

Sign up to request clarification or add additional context in comments.

Comments

2

If you're using jquery, you can use ready()

Comments

2

Adding it to the end is actually wrong because of the way it may behave with different browsers.

You should add it to the onload event of the body tag.

e.g

<body onload="DoAfterPageLoad()">

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.