SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Addict sedna's Avatar
    Join Date
    Jan 2006
    Posts
    272
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Javascript start after HTML

    Hey Guys Jscript newbie here lol,

    I was wondering what command do I use so that the HTML finishes loading before the Javascript start to work?

    Thanks

    Joe

  2. #2
    SitePoint Member
    Join Date
    May 2008
    Posts
    10
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    use <script>

    Quote Originally Posted by sedna View Post
    Hey Guys Jscript newbie here lol,

    I was wondering what command do I use so that the HTML finishes loading before the Javascript start to work?

    Thanks

    Joe

  3. #3
    SitePoint Enthusiast
    Join Date
    Feb 2007
    Posts
    27
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You can use the window.onload event but this can cause a pause if you have big image or media files.

    the easiest way is to place you js code just before the </body> that way you know that the html is loaded.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •