![]() |
Replace part of page with additional html
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 |
Re: Replace part of page with additional html
Previously in alt.html, Nonee <None@none.com> said:
> I am designing a website with a menu and I would like to place > the menu (which is in a table) Why? http://allmyfaqs.com/faq.pl?Tableless_layouts > on every page. http://allmyfaqs.com/faq.pl?Include_one_file_in_another -- Mark Parnell http://www.clarkecomputers.com.au alt.html FAQ :: http://html-faq.com/ |
Re: Replace part of page with additional html
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 |
Re: Replace part of page with additional html
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. |
Re: Replace part of page with additional html
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 |
Re: Replace part of page with additional html
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 |
Re: Replace part of page with additional html
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" <info@seven-g.net> 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 |
Re: Replace part of page with additional html
> From: Nonee <None@none.com>
> > 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 |
Re: Replace part of page with additional html
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 <dorayme@optusnet.com.au> wrote: >> From: Nonee <None@none.com> >> >> 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 |
Re: Replace part of page with additional html
Previously in alt.html, Nonee <None@none.com> 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/ |
| All times are GMT. The time now is 01:59 PM. |
Powered by vBulletin®. Copyright ©2000 - 2013, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.