views:

51

answers:

1

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

+1  A: 

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

dbones
"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*.
cHao
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?
dbones