0

Is there a way to run my own javascript after all JS files have loaded and ASP.NET javascript has finished initialized and loaded. I am currently using jQuery to run javascript after page load and that does not guarantee it will load after ASP.NET javascript. Thanks

2
  • are you having an issue with something specific? afaik all js added by asp.net runs immediately. Commented Oct 4, 2010 at 20:03
  • Not all JS added by ASP.net controls, especially third-party ones. Some of them need to wait for the document to finish loading as well. Commented Oct 4, 2010 at 20:11

1 Answer 1

1

have you looked at the

.ready()

documented here http://api.jquery.com/ready/

it should run once the Dom is ready to use.

PS what do you mean by ASP.NET JavaScript, any JS generated from ASP.NET will be done before the page is returned to the client. the second the page is returned to the user, all the JS should be generated, or linked too (if in an external js file)

EDIT:

did you mean in your JS they run on doc ready, and you would like to run yours after this?

could you not make a script, which calls all the functions in order? like this

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

2 Comments

"I am currently using jQuery to run javascript after page load" means ready() is already in use. The problem is that any number of other scripts could be not-yet run and might need their own ready() handlers -- and ready() sets stuff up to run in the order it was added. It doesn't provide a way to guarantee that a given script will run last.
thanks, I thought I may have got hold of wrong end of the stick.. I normally use a JS function to setup my other JS objects. Other than this my best guess would be to move your code to the last point of the JS registration?

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.