Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > Replace part of page with additional html

Reply
Thread Tools

Replace part of page with additional html

 
 
Nonee
Guest
Posts: n/a
 
      07-19-2005
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
 
Reply With Quote
 
 
 
 
Mark Parnell
Guest
Posts: n/a
 
      07-19-2005
Previously in alt.html, Nonee <(E-Mail Removed)> 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/
 
Reply With Quote
 
 
 
 
Roy Schestowitz
Guest
Posts: n/a
 
      07-19-2005
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
 
Reply With Quote
 
Neredbojias
Guest
Posts: n/a
 
      07-19-2005
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.
 
Reply With Quote
 
seven-G
Guest
Posts: n/a
 
      07-19-2005
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


 
Reply With Quote
 
seven-G
Guest
Posts: n/a
 
      07-19-2005
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

 
Reply With Quote
 
Nonee
Guest
Posts: n/a
 
      07-19-2005
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" <(E-Mail Removed)> 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


 
Reply With Quote
 
dorayme
Guest
Posts: n/a
 
      07-19-2005
> From: Nonee <(E-Mail Removed)>
>
> 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

 
Reply With Quote
 
Nonee
Guest
Posts: n/a
 
      07-20-2005
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 <(E-Mail Removed)>
wrote:

>> From: Nonee <(E-Mail Removed)>
>>
>> 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


 
Reply With Quote
 
Mark Parnell
Guest
Posts: n/a
 
      07-20-2005
Previously in alt.html, Nonee <(E-Mail Removed)> 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/
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Html Form looses Focus when applet is part of html-page Gruupy Javascript 0 08-15-2006 01:02 PM
Load additional dlls from asp.net page Stefan Reinmers ASP .Net 0 01-04-2006 06:40 AM
copy part of HTML Table to another HTML page lvcha.gouqizi ASP General 0 12-29-2005 03:46 AM
How to pass additional parameter to error page pawel.pabich@gmail.com ASP .Net 4 09-09-2005 02:50 PM
datagrid to generate additional querystring collection item to pull off on the target page for input into a condition statement test variable...?? Hazzard ASP .Net 1 04-02-2004 06:48 PM



Advertisments