dcsimg
www.webdeveloper.com
Results 1 to 6 of 6

Thread: Load multiple instances on same page

  1. #1
    Join Date
    Mar 2007
    Posts
    35

    Load multiple instances on same page

    Hey everyone, I'm developing a new site right now. I'm trying to make it so I can have a nav panel on the side and when each area is clicked on, it loads into a data area located on that page instead of having to load a new page every time. I does not have to be HTML, I just posted it here.

    My new site

  2. #2
    Join Date
    Nov 2002
    Location
    Baltimore, Maryland
    Posts
    12,279
    Loading the whole page isn't so bad. You could use FRAMEs, they work but are rather yucky. Or you could use Ajax which is nice but doesn't work. If you really need this feature I would suggest a well designed Ajax solution--one where the whole page loads when the Ajax doesn't work. The way to do that is to start with a non-JavaScript, non-Ajax page with real links that work like normal. Then you add the Ajax with you links looking something like <a href="next.html" onclick="return loadNext()">. The idea is that "loadNext()" returns false when the Ajax is successful which cancells the href call. If you are really cleaver, the Ajax and the href can both call the same server side script which returns the whole page or just the fragment as required.

    For details see the JavaScript forum but be careful. They have pretty low standards over there. You might have to adapt the Ajax so it fails gracefully.
    “The power of the Web is in its universality. Access by everyone regardless of disability is an essential aspect.”
    —Tim Berners-Lee, W3C Director and inventor of the World Wide Web

  3. #3
    Join Date
    Mar 2007
    Posts
    35
    sounds like doing this is pretty shaky. I may just create all the individual pages, and add my nav bar to each.

  4. #4
    Join Date
    Nov 2002
    Location
    Baltimore, Maryland
    Posts
    12,279
    If you're just trying to save some typing and make it easier to maintain then look into Server Side Includes.
    “The power of the Web is in its universality. Access by everyone regardless of disability is an essential aspect.”
    —Tim Berners-Lee, W3C Director and inventor of the World Wide Web

  5. #5
    Join Date
    Mar 2007
    Posts
    35
    Im really just looking for a cleaner look, and a little less typing on my end. I dont mind the work really. I can easily do it.

  6. #6
    Join Date
    Nov 2002
    Location
    Baltimore, Maryland
    Posts
    12,279
    The definately go with the Ajax with the fail-safe feature. The good folks at the JavaScript forum will get you started with the Ajax but it is likely that you'll have to figure out the fail-safe part on your own. (The folks over there are blind to the fact that JavaScript doesn't actually work.)
    “The power of the Web is in its universality. Access by everyone regardless of disability is an essential aspect.”
    —Tim Berners-Lee, W3C Director and inventor of the World Wide Web

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