Results 1 to 5 of 5

Thread: dHTML in separate file?

  1. #1
    Join Date
    Jun 2006
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default dHTML in separate file?

    I am wondering how I can put a menu in a separate file and have it dynamically displayed in an HTML page.

    This would be very similar to using frames (have the same menu on 50 different pages, but use 1 file for the menu for ease of editing), but without using frames.

    Does anyone know how to do this. I know I can use PHP and include files, but I am wondering how to use DHTML to do it.

    Any insight would be greatly appreciated. Thanks.

    ryanod

  2. #2
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    It's not really possible. You can include scripts with <script src="..." type="text/javascript"></script>, and CSS with <link rel="stylesheet" type="text/css" href="...">, but there's no acceptable way to include HTML client-side. You can do it by having document.write() calls in an external script, which you can include, but it's not a good idea.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  3. #3
    Join Date
    Jun 2006
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    So, does that mean that if you have a corporate web page that has, say, 100 separate pages and each one has a CSS based drop down menu you have to code in the HTML based content for the menu on every page??

    What happens if you want to change the menu?? Do you have to change every single page?? Is there a batch method for accomplishing this??

    Maybe the answer is obvious and that answer is to use PHP or ASP to design this kind of site??

    Thanks for the response.

    ryanod

  4. #4
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    Maybe the answer is obvious and that answer is to use PHP or ASP to design this kind of site??
    Right Server-side languages are the only acceptable way of doing this.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  5. #5
    Join Date
    Jun 2006
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Thanks for the confirmation.

    ryanod

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
  •