+ Reply to Thread
Page 1 of 3 123 LastLast
Results 1 to 10 of 26

Thread: Html Js page loader

  1. #1
    Teensweb is offline x10 Lieutenant Teensweb is an unknown quantity at this point
    Join Date
    May 2008
    Posts
    352

    Html Js page loader

    Does anyone know how to create a pageloader with a progress bar that would show the percentage (with html/js)?

  2. #2
    blueiron's Avatar
    blueiron is offline x10Hosting Member blueiron is an unknown quantity at this point
    Join Date
    Jan 2009
    Location
    California
    Posts
    19

    Re: Html Js page loader

    Never really seen the need for something like that.
    The only way I can think of completing it, would be to have an AJAX script load the page, and until the page is loaded it would display the progress bar.

    You could set the progress bar up based on a page-size in Bytes, or Kilobytes, and have the AJAX script somehow sum up the currently loaded bytes and compare them to the pages set bytes amount.

    But I haven't had enough experience in JAVA/AJAX to know how to do that off-hand.

  3. #3
    diabolo's Avatar
    diabolo is offline Community Advocate diabolo is on a distinguished road
    Join Date
    Nov 2007
    Location
    Jersey Shore
    Posts
    1,683

  4. #4
    VPmase's Avatar
    VPmase is offline x10 Elder VPmase is an unknown quantity at this point
    Join Date
    Nov 2007
    Location
    Dixon, IL, USA
    Posts
    914

    Re: Html Js page loader

    Are you trying to load the page without refreshing? Aka AJAX?

    http://www.w3schools.com/ajax/ is where I learned AJAX.

  5. #5
    xav0989's Avatar
    xav0989 is offline Community Public Relation xav0989 is just really nice
    Join Date
    Jul 2008
    Location
    ifk
    Posts
    4,438

    Re: Html Js page loader

    Unless you are building a photo gallery, aka a page with loads of picture, I'd say javascript page loader are pretty useless. If you are trying to use AJAX, then a simple div with 'Loading...' in it is sufficient.
    If you are trying to have a JS loader for a normal page (html + css + some simple images) then you should not have a loader.
    Last edited by xav0989; 02-07-2009 at 09:16 PM.
    Xavier L | Community Public Relations Manager (Free Hosting Support)
    █ Yes, my position is too cool to even exist!
    How am I helping? Rate this post by clicking the icon below! (this is even better than "liking" a post)
    Terms of Service | Acceptable Use Policy | x10Hosting Wiki

  6. #6
    Teensweb is offline x10 Lieutenant Teensweb is an unknown quantity at this point
    Join Date
    May 2008
    Posts
    352

    Re: Html Js page loader

    can anyone give me the right code?
    Edit:
    If anyone did not understand, i'll make it clear: I am looking for something that does the following-
    1. While an html/php page is being loaded- show a division that covers the entire page.
    2. On top of it, show a percent loader which shows the whole page's(not only the imgs) progress
    3. And that should not be based on flash.
    4. I want an image(custom) to show the progress not just a color.
    Last edited by Teensweb; 02-08-2009 at 04:39 AM. Reason: Automerged Doublepost

  7. #7
    VPmase's Avatar
    VPmase is offline x10 Elder VPmase is an unknown quantity at this point
    Join Date
    Nov 2007
    Location
    Dixon, IL, USA
    Posts
    914

    Re: Html Js page loader

    I don't think there is a way to get the percentage loaded of a webpage in that same webpage.

  8. #8
    sonicsshadow is offline x10 Sophmore sonicsshadow is an unknown quantity at this point
    Join Date
    Nov 2007
    Posts
    198

    Re: Html Js page loader

    Not to be rude, but isn't this why we have the progress bar in most web browsers?

    Also, I know JSQuery has something that checks if the page is ready to use, maybe you could use that to check if the page isn't loaded.

    What you could also do is create your entire site and then make it so the Javascript outputs your website to a hidden div. As it outputs your website, you can manually have it so like when it prints out each paragraph, you increase the progress variable. Then, for the image, increase the width of it each time the percent increases, so it looks like it's filling up more space. Once the percent variable reaches 100, you could then hide the div with the loading bar in it and then show the div with the site on it.

    I don't know WHY you would want this though.
    Last edited by sonicsshadow; 02-08-2009 at 01:20 PM.

  9. #9
    mattura's Avatar
    mattura is offline x10 Elder mattura is an unknown quantity at this point
    Join Date
    Oct 2007
    Posts
    563

    Re: Html Js page loader

    I agree with xav0989.
    There are two possible situations:

    1) You have a massive page with loads of content, it loads slowly, piece by piece and you want it all to appear in a flash (no, not Macromedia Flash), at once.

    2) You don't have a massive page, but you want a fancy loader screen to make your site look cool, and show the progress whilst loading the page.

    For situation 1, your best bet is to load the bulk of the content separately, using AJAX/javascript/splitting into separate web pages/whatever method. You can even have a loader bar for each bit!
    Most web users will not tolerate long waiting times (long can be a few seconds!). So it is always a good idea to split up bulky pages into separate sections on a web site.

    In situation 2, most likely users would barely see your loader before the page replaces it (unless you fake a timer). Realistically, waiting for a page to load involves some time before the page starts to load (which probably takes up the most time), and this you can do nothing about. You can't even load your loader. Then, some time when the page is loading, usually very quickly. Hence the loader would flash up for a split second. Not worth the effort!
    ----
    Life is a game. The conception is terrible but the graphics are amazing!
    matt.elementfx.com

  10. #10
    Teensweb is offline x10 Lieutenant Teensweb is an unknown quantity at this point
    Join Date
    May 2008
    Posts
    352

    Re: Html Js page loader

    Quote Originally Posted by mattura View Post
    I agree with xav0989.
    There are two possible situations:
    2) You don't have a massive page, but you want a fancy loader screen to make your site look cool, and show the progress whilst loading the page.

    In situation 2, most likely users would barely see your loader before the page replaces it (unless you fake a timer). Realistically, waiting for a page to load involves some time before the page starts to load (which probably takes up the most time), and this you can do nothing about. You can't even load your loader. Then, some time when the page is loading, usually very quickly. Hence the loader would flash up for a split second. Not worth the effort!
    I'll make sure that my page loads slowly enogh!:laugh:

+ Reply to Thread
Page 1 of 3 123 LastLast

Similar Threads

  1. Hybrid's HTML Lessons
    By Hybrid in forum Tutorials
    Replies: 18
    Last Post: 11-28-2009, 02:12 PM
  2. Unique php page
    By bunglebrown in forum Programming Help
    Replies: 48
    Last Post: 11-08-2008, 08:59 AM
  3. Passing variables from page to page
    By os242 in forum Scripts & 3rd Party Apps
    Replies: 3
    Last Post: 09-15-2007, 02:05 PM
  4. [IPB] Contiguous Board Index
    By phenetic in forum Tutorials
    Replies: 5
    Last Post: 09-18-2005, 10:31 AM
  5. Ads on Every Page?
    By ThaoD in forum Free Hosting
    Replies: 5
    Last Post: 08-23-2005, 05:44 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers