Replace part of page with additional html

Discussion in 'HTML' started by Nonee, Jul 19, 2005.

  1. Nonee

    Nonee Guest

    Hello-

    I am designing a website with a menu and I would like to place
    the menu (which is in a table) on every page. I would like to be able
    to call an external javascript function call to write it but I haven't
    quite figured out how. I know that document.write('blah blah') could
    do it but that completely rewrites the entire site while I only want
    to put the table there, in between a title image and the rest of the
    web content. I know there is innerhtml calls for IE but 1) I am not
    sure how it works and 2) I rather not shoot myself in the foot in the
    cross-compatibility factor.

    Any ideas?

    Thanks,

    Josh
     
    Nonee, Jul 19, 2005
    #1
    1. Advertising

  2. Nonee

    Mark Parnell Guest

    Mark Parnell, Jul 19, 2005
    #2
    1. Advertising

  3. Nonee wrote:

    > Hello-
    >
    > I am designing a website with a menu and I would like to place
    > the menu (which is in a table) on every page. I would like to be able
    > to call an external javascript function call to write it but I haven't
    > quite figured out how.



    JavaScript runs on the client's side. Why not use Server Side Includes
    (SSI)? You can also use Perl script to add the menu offline.

    I have some shell scripts that will apply the changes to a menu recursively.
    I use it all the time for very many purposes including embedment of RSS
    feeds in pages: http://www.schestowitz.com/Software/Search_and_Replace/


    > I know that document.write('blah blah') could
    > do it but that completely rewrites the entire site while I only want
    > to put the table there, in between a title image and the rest of the
    > web content. I know there is innerhtml calls for IE but 1) I am not
    > sure how it works and 2) I rather not shoot myself in the foot in the
    > cross-compatibility factor.
    >
    > Any ideas?
    >
    > Thanks,
    >
    > Josh



    Try to avoid JavaScript. Cross(platform)-compatibility would not be an
    issue, but browser compatibility would. There is also a performance
    penalty.

    Roy

    --
    Roy S. Schestowitz
    http://Schestowitz.com
     
    Roy Schestowitz, Jul 19, 2005
    #3
  4. Nonee

    Neredbojias Guest

    With neither quill nor qualm, Nonee quothed

    > Hello-
    >
    > I am designing a website with a menu and I would like to place
    > the menu (which is in a table) on every page. I would like to be able
    > to call an external javascript function call to write it but I haven't
    > quite figured out how. I know that document.write('blah blah') could
    > do it but that completely rewrites the entire site while I only want
    > to put the table there, in between a title image and the rest of the
    > web content. I know there is innerhtml calls for IE but 1) I am not
    > sure how it works and 2) I rather not shoot myself in the foot in the
    > cross-compatibility factor.
    >
    > Any ideas?


    Though I agree with the suggestion about server-side being better, you
    can call an external javascript with something like:

    <script type="text/javascript" src="ext1.js"></script>

    The ext1.js is another file which should contain a document.write that
    can be inserted wherever you want in the body of the main page(s).

    --
    Neredbojias
    Contrary to popular belief, it is believable.
     
    Neredbojias, Jul 19, 2005
    #4
  5. Nonee

    seven-G Guest

    Hi Josh!

    You can create a "template" if you have Dreamweaver. Apply he template
    to any additional page you create and that's it. Dreamweaver has very
    simple instructions in its tutorial that can guide you through the
    process. Later if you want to change or add a link to your main menu,
    just open the template and save it. Then you have to open all the rest
    of the pages and press "update" under the template menu and that's it!
    Try it, once you read the tutorial you'll realize it is very simple.

    Good Luck!

    Gabylana
    www.seven-g.net




    Nonee wrote:
    > Hello-
    >
    > I am designing a website with a menu and I would like to place
    > the menu (which is in a table) on every page. I would like to be able
    > to call an external javascript function call to write it but I haven't
    > quite figured out how. I know that document.write('blah blah') could
    > do it but that completely rewrites the entire site while I only want
    > to put the table there, in between a title image and the rest of the
    > web content. I know there is innerhtml calls for IE but 1) I am not
    > sure how it works and 2) I rather not shoot myself in the foot in the
    > cross-compatibility factor.
    >
    > Any ideas?
    >
    > Thanks,
    >
    > Josh
     
    seven-G, Jul 19, 2005
    #5
  6. Nonee

    seven-G Guest

    Hi Josh!

    You can create a "template" if you have Dreamweaver. Apply he template
    to any additional page you create and that's it. Dreamweaver has very
    simple instructions in its tutorial that can guide you through the
    process. Later if you want to change or add a link to your main menu,
    just open the template and save it. Then you have to open all the rest
    of the pages and press "update" under the template menu and that's it!
    Try it, once you read the tutorial you'll realize it is very simple.

    Good Luck!

    Gabylana
    www.seven-g.net
     
    seven-G, Jul 19, 2005
    #6
  7. Nonee

    Nonee Guest

    Perfect! I am using dreamweaver and that works great!

    Thank you Gabylana and everyone else for your replies.

    I really appreciate it!

    On 19 Jul 2005 12:11:54 -0700, "seven-G" <> wrote:

    >Hi Josh!
    >
    >You can create a "template" if you have Dreamweaver. Apply he template
    >to any additional page you create and that's it. Dreamweaver has very
    >simple instructions in its tutorial that can guide you through the
    >process. Later if you want to change or add a link to your main menu,
    >just open the template and save it. Then you have to open all the rest
    >of the pages and press "update" under the template menu and that's it!
    >Try it, once you read the tutorial you'll realize it is very simple.
    >
    >Good Luck!
    >
    >Gabylana
    >www.seven-g.net
    >
    >
    >
    >
    >Nonee wrote:
    >> Hello-
    >>
    >> I am designing a website with a menu and I would like to place
    >> the menu (which is in a table) on every page. I would like to be able
    >> to call an external javascript function call to write it but I haven't
    >> quite figured out how. I know that document.write('blah blah') could
    >> do it but that completely rewrites the entire site while I only want
    >> to put the table there, in between a title image and the rest of the
    >> web content. I know there is innerhtml calls for IE but 1) I am not
    >> sure how it works and 2) I rather not shoot myself in the foot in the
    >> cross-compatibility factor.
    >>
    >> Any ideas?
    >>
    >> Thanks,
    >>
    >> Josh
     
    Nonee, Jul 19, 2005
    #7
  8. Nonee

    dorayme Guest

    > From: Nonee <>
    >
    > Hello-
    >
    > I am designing a website with a menu and I would like to place
    > the menu (which is in a table) on every page. I would like to be able
    > to call an external javascript function call to write it but I haven't
    > quite figured out how. I know that document.write('blah blah') could
    > do it but that completely rewrites the entire site while I only want
    > to put the table there, in between a title image and the rest of the
    > web content. I know there is innerhtml calls for IE but 1) I am not
    > sure how it works and 2) I rather not shoot myself in the foot in the
    > cross-compatibility factor.
    >
    > Any ideas?
    >
    > Thanks,
    >
    > Josh
    >


    You have a menu and you would like to place it it on every page. How many
    pages are we talking here? If just a few, like 10 to 50 then just place it
    on every page. This way there is no need to use javascript (which is not
    always on and/or working in browsers) or get fancy. You can get fancier
    using "includes" and php and server side set ups. But think whether there is
    a true need in your case. (What's this about a bit of "write" in javascript
    "completely rewriting the entire site"? This sounds a bit dramatic and
    unlikely? You can just write the teeniest weeniest thing with it.

    dorayme
     
    dorayme, Jul 19, 2005
    #8
  9. Nonee

    Nonee Guest

    Actually since I have all of your attentions... I am having a problem
    with the document.write('') method. Everytime I use it, it rewrites
    the entire page. I am not sure why that is. Could including a
    function call that uses the doc.write method in the body onload event
    be doing it? It just completely blanks out the entire page and only
    puts in the doc.write string. Any ideas?

    Thanks again,

    Josh

    P.S. Oh, and Dorayme, yes it is under 50 pages, I just thought there
    could be an easier way. The dreamweaver template idea worked very
    well. I am just lazy I guess... : )

    On Wed, 20 Jul 2005 08:55:27 +1000, dorayme <>
    wrote:

    >> From: Nonee <>
    >>
    >> Hello-
    >>
    >> I am designing a website with a menu and I would like to place
    >> the menu (which is in a table) on every page. I would like to be able
    >> to call an external javascript function call to write it but I haven't
    >> quite figured out how. I know that document.write('blah blah') could
    >> do it but that completely rewrites the entire site while I only want
    >> to put the table there, in between a title image and the rest of the
    >> web content. I know there is innerhtml calls for IE but 1) I am not
    >> sure how it works and 2) I rather not shoot myself in the foot in the
    >> cross-compatibility factor.
    >>
    >> Any ideas?
    >>
    >> Thanks,
    >>
    >> Josh
    >>

    >
    >You have a menu and you would like to place it it on every page. How many
    >pages are we talking here? If just a few, like 10 to 50 then just place it
    >on every page. This way there is no need to use javascript (which is not
    >always on and/or working in browsers) or get fancy. You can get fancier
    >using "includes" and php and server side set ups. But think whether there is
    >a true need in your case. (What's this about a bit of "write" in javascript
    >"completely rewriting the entire site"? This sounds a bit dramatic and
    >unlikely? You can just write the teeniest weeniest thing with it.
    >
    >dorayme
     
    Nonee, Jul 20, 2005
    #9
  10. Nonee

    Mark Parnell Guest

    Previously in alt.html, Nonee <> said:

    > I am having a problem
    > with the document.write('') method. Everytime I use it, it rewrites
    > the entire page. I am not sure why that is. Could including a
    > function call that uses the doc.write method in the body onload event
    > be doing it? It just completely blanks out the entire page and only
    > puts in the doc.write string. Any ideas?


    If you are using it for something as essential as a menu, stop it.

    As far as the actual behaviour you're describing, it's impossible to say
    without a URL what is causing it. You may also get better responses to
    that question in news://comp.lang.javascript since it's a Javascript
    issue (though a URL will probably still be necessary).

    --
    Mark Parnell
    http://www.clarkecomputers.com.au
    alt.html FAQ :: http://html-faq.com/
     
    Mark Parnell, Jul 20, 2005
    #10
  11. Nonee

    dorayme Guest

    > From: Nonee <>
    >
    > P.S. Oh, and Dorayme, yes it is under 50 pages, I just thought there
    > could be an easier way. The dreamweaver template idea worked very
    > well. I am just lazy I guess... : )


    I understand. Personally I hate all these wsiwigs but I guess they can
    really save time. But if it is for not a huge amount of pages, this is no
    big deal. Happily enough, I insert changes and repeated elements in multiple
    pages via search and replace functions in my text editor, sometimes using
    grep patterns, and it would not be any slower than Dreamweaver.

    "Includes" have the advantage that when you change the menu, you just upload
    it once to a server. Otherwise, however easily you insert the code on each
    page, you still need to upload them to the server. But again, it does not
    take much as you can do this in great dollops of multi files too. Not as
    elegant, true... but sshh, who is to know?

    dorayme
     
    dorayme, Jul 20, 2005
    #11
  12. Nonee

    Neredbojias Guest

    With neither quill nor qualm, Nonee quothed

    > Actually since I have all of your attentions... I am having a problem
    > with the document.write('') method. Everytime I use it, it rewrites
    > the entire page. I am not sure why that is. Could including a
    > function call that uses the doc.write method in the body onload event
    > be doing it?


    Yes. Without double-checking this, I'm pretty sure you cannot write to
    the page once it's "loaded" - as in "onloaded." I believe I tried that
    once with results similar to yours.

    > It just completely blanks out the entire page and only
    > puts in the doc.write string. Any ideas?


    --
    Neredbojias
    Contrary to popular belief, it is believable.
     
    Neredbojias, Jul 20, 2005
    #12
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Hazzard
    Replies:
    1
    Views:
    489
    Hazzard
    Apr 2, 2004
  2. Replies:
    4
    Views:
    2,624
  3. Stefan Reinmers

    Load additional dlls from asp.net page

    Stefan Reinmers, Jan 4, 2006, in forum: ASP .Net
    Replies:
    0
    Views:
    501
    Stefan Reinmers
    Jan 4, 2006
  4. lvcha.gouqizi

    copy part of HTML Table to another HTML page

    lvcha.gouqizi, Dec 29, 2005, in forum: ASP General
    Replies:
    0
    Views:
    189
    lvcha.gouqizi
    Dec 29, 2005
  5. Gruupy
    Replies:
    0
    Views:
    313
    Gruupy
    Aug 15, 2006
Loading...

Share This Page