www.webdeveloper.com
Results 1 to 2 of 2

Thread: Loading Javascript

  1. #1
    Join Date
    Oct 2010
    Posts
    1

    Loading Javascript

    Hi,

    I have a long function in javascript and my page loads very slow.

    Is it possible to control when will the page download the javascript?

    Or is it possible for the javascript to be downloaded after the whole page and the css is done loading?

    note: I only have one html page with many tabs. only one tab uses the long function. I want users of my website to be able to navigate through other tabs while the long javascript downloads.

    Thanks.

  2. #2
    Join Date
    Apr 2010
    Location
    Salem,Ma
    Posts
    623
    without knowing anything else, I would say, load your script at the bottom of the page instead of in the head tag. Since it sounds like the functionality of your script wont be needed until someone clicks on that tab, it most likely will not effect the user, other than the script will be the last thing to load instead of the first.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles