I would like to execute some Javascript after the document has loaded and even after the document.onload functions have been executed.

Situation:

I'm loading a text-edit field through ajax. When the user submits the form, he is redirected to a PHP file. That PHP file redirects him back to "file.php" using header('location: file.php');

What I want to do is to execute some Javascript actions in file.php, but when I print the <script></script> tags the file id displayed blank - nothing is loaded at all. As soon as I leave them out, the page does get loaded.

Any suggestions?

what exactly do you mean? running it when you press a button, running it after the page has loaded with a time-interval, ... ?

not sure what you mean, but I'm pretty sure there 'll be a javascript or jQuery library "out there" that can do exactly what you want it to do.

Solved. The problem was not that it's impossible to load <script> tags, it was just an error in the code.. Stupid me :).

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.