SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Enthusiast Pure L's Avatar
    Join Date
    Oct 2007
    Posts
    47
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    hiding/showing divs vs. standard html pages?

    Hi all.

    Just curious about how everyone feels about something.

    I'm doing a page for a gal and she's not exactly web-savvy.

    As it stands, her site is basically an advertisement for her business (which she is satisfied with). Also, as it stands, I have the site set up so instead of the various "pages" being different html pages (i.e. different addresses like home.html, contact.html, etc.), I'm just hiding and showing divs.

    Basically just changing the class of each div from "display:hidden" to "display:block" when the user clicks on each menu item.

    This results in no page reloads and everything has a really nice, zippy feel to it.

    I understand that this does limit the site in that you can't directly link to anything but the index page but that doesn't really bother me (nor the business owner.....I'm not even sure if she realizes what's going on).

    Something I'm curious about though is that some pages I've been to (with standard, home.html, contact.html-type pages) are actually really, really fast loading and I don't notice the page reloads happening at all.

    How are they accomplishing this? Ajax? Can you use Ajax to load all the pages in the background before a click?

    Actually, I've looked at the source on a couple of these pages and they were just standard css/html pages with no <script> tags to speak of.

    Hmmm.....

    Just thinking out loud. Any responses are always appreciated. This is a great forum.

  2. #2
    Function Curry'er JimmyP's Avatar
    Join Date
    Aug 2007
    Location
    Brighton, UK
    Posts
    2,006
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The only thing that comes to mind with hiding and showing divs instead of using actual pages is SEO and usability... But that does not seem to be an issue with your 'client', so I think it's fine doing it that way...

    You just have to consider the possibility of JS not being enabled... - You could use a solution to make it possible for non-JS-users to visit the actual pages -and with JS-users - they can have it as it is...

    I am not sure about the fast-loading websites you speak of...

    - They could just be hosted on a very fast server - with little traffic
    - They might be using frames so only content reloads
    - And, as you suggested, they could be using AJAX
    James Padolsey
    末末末末末末末末末末末末末末末末末末末
    Awesome JavaScript Zoomer (demo here)
    'Ajaxy' - Ajax integration solution (demo here)

  3. #3
    Unobtrusively zen silver trophybronze trophy
    paul_wilkins's Avatar
    Join Date
    Jan 2007
    Location
    Christchurch, New Zealand
    Posts
    14,684
    Mentioned
    100 Post(s)
    Tagged
    4 Thread(s)
    @Pure L: If you provide an example of two of the websites that have taken your interest because of their speed, we should be able to help explain.

    My suspicion is that aggressive caching is responsible for them being so fast, but without actual examples to work with, there is little of actual use that you can be advised about.
    Programming Group Advisor
    Reference: JavaScript, Quirksmode Validate: HTML Validation, JSLint
    Car is to Carpet as Java is to JavaScript


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
  •