NameSilo

Load Javascript Last...

Spaceship Spaceship
Watch

boomers

Established Member
Impact
4
Hello

Im 99% sure that a few weeks ago I saw an easy way to make your javascript load after the rest of the page has loaded... however I didnt bookmark the page.

If anyone knows how to do this then please let me know :)
 
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
AfternicAfternic
Code:
window.onload = function () {
  // The JS here will run after the page loaded
}
Is that what you're asking for?
 
0
•••
I should have been clearer but my knowledge of JS is very poor, however my HTML is

Code:
<script language='javascript' src='URL'></script>

So the option to use onload isnt there.
 
0
•••
If you want all of the JS in that file to load after the page is done loading, I'd need to see it to be able to make that work.
 
0
•••
Its just an include file - the source is just something that writes out text... literally, I thought a few weeks ago I saw that something could be put after the 'language=javascript' part. Just cant find out what it was :(
 
0
•••
You could put the <script> stuff at the end of the file..
 
0
•••
just drop it after all the html, especially if you need to manipulate form values.
 
0
•••

We're social

Unstoppable Domains
Domain Recover
DomainEasy — Zero Commission
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back