Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 7 of 7
  1. #1
    Junior Member
    Join Date
    Jul 2003
    Posts
    4
    Member #
    1972
    I am using an external CSS and div tags to center/space the content on my site. I use seperate divs for the top, left, middle, and right sections of my webpage to avoid using frames.
    The content of the middle div is all that scrolls on the page. That's the way I want it.
    I'm not that experienced with javascript and I want to know if I can use it to change the content (text AND graphics )of the middle div tag just by clicking a button in the navigation menu. The navigation buttons/links are in their own div.
    I don't really want to load a whole new page if just the content of the middle div is changing. Can this be done?:devious:

  2.  

  3. #2
    JR
    JR is offline
    Senior Member JR's Avatar
    Join Date
    Nov 2002
    Location
    UK
    Posts
    4,354
    Member #
    257
    I made a quick file for you, although i do not think this is a good idea because it is bad for search engines for a start.

    You may want to look into using a server side language (SHTML, PHP, ASP) to include parts of your page that stay the same. Do a search on includes and i am sure you will find loads of info.
    JR

  4. #3
    Member nepharo's Avatar
    Join Date
    Jun 2003
    Posts
    73
    Member #
    1729
    You are a very helpful guy, jr.
    I cannot self terminate, you must lower me into the fire.

  5. #4
    JR
    JR is offline
    Senior Member JR's Avatar
    Join Date
    Nov 2002
    Location
    UK
    Posts
    4,354
    Member #
    257
    thanks
    JR

  6. #5
    Junior Member
    Join Date
    Jul 2003
    Posts
    4
    Member #
    1972
    Thanks for the help JR,
    Your code really helped me out. But you say this code is bad for search engines.
    So will I be better off having my links load a fresh new page for better search engine manageability?
    I'm just making a personal website using the free webspace from my ISP provider. Could I still use server side includes or do I need to pay a seperate site for web-hosting?
    Also, I'm looking for a way to make my fixed divs work in both the latest IE and NetScape browsers. For now, I know that the site works with IE6. I tried it in NS 7 and it doesn't show up properly, but I'm not too concerned about that right now.
    -update
    Here's another question. I want to use the code you gave me to change the content of the body, instead of updating the div. What changes do I need to make.
    I've tried this change; is it a step in the right direction?:
    function contentload(page) {
    document.body.innerHTML = content[page]

    But I don't know what to replace the div call in the <body> with.

  7. #6
    JR
    JR is offline
    Senior Member JR's Avatar
    Join Date
    Nov 2002
    Location
    UK
    Posts
    4,354
    Member #
    257
    Well if it is a personal site then i doubt you will need it to be searched for so the div method is fine.

    I doubt the free webspace your ISP offers allows any server side language, but it might allow SHTML, but i know nothing about it so somebody else will have to answer that.

    I tested the code in Netscape 7 and it works fine for me

    I think your best bet here would be to put the <div></div> tags just inside the <body></body> tags. But if you have a lot of code that needs changing it will make the size of your website very large because it will need to be stored in the javascript array. So i think your best bet here is to look into using a server side language (if available) or just do it the normal way by having seperate pages. If your nav is just HTML (no images, flash etc.) then it should appear to stay there anyway when you go to a new page.
    JR

  8. #7
    Junior Member
    Join Date
    Jul 2003
    Posts
    4
    Member #
    1972
    Your code by itself works fine in NE 7.
    It's just my site-setup of absolute positioned divs that doesn't work well with NE 7. I'm using code that shows the divs fine in IE, but in NE 7 my divs don't show.
    I do have the <div></div> tags inside the <body></body> tags. Just thought that taking out the div and using the body tag directly would be simpler.
    I will use separate pages, and your code as well for one of the links on my page.


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 02:10 PM.
Powered by vBulletin® Version 4.2.3
Copyright © 2020 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com