Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Navigation Bar in Javascript

Status
Not open for further replies.

PeloGFX

Programmer
May 21, 2002
13
US
I've had my site up only for a few days and I'm already sick of editing things. I'm using tables in HTML so it gets really difficult having to change the same thing on EVERY page every time I change something on the navigational bar. My web host doesn't support any server-side laguanges so I'm wondering if there's a way to have 1 page called navbar and I would only have to edit that, basically the exact same thing as frames but without using frames, possibly with JavaScript. I hate frames. Thanks. ~PeloGFX
 
Well, you can use IFRAMES instead then, that is the only other alternative appart from using PHP etc to recall and print scipting from separate file...


<iframe width=500 height=500 src=&quot;navbar.htm&quot;></iframe>

Inline frames can be used just like normal tables...

regards

adam
 
Can you still scroll just using 1 scroll bar instead of having to use 2 bars, like you have to when using regular frames? ~PeloGFX
 
Hi mate,

You could use JavaScript to do this.

Just create a js file and use document.write for all the html, then call that file into every page.

Hope this helps Wullie

- Send your letter to santa!!

The pessimist complains about the wind. The optimist expects it to change. The leader adjusts the sails. - John Maxwell
 
I thought of that, but can you do images and things with JS? ~PeloGFX
 
Yes. You can create entire HTML files using document.write

example:

<script language=&quot;javascript&quot;>
<!--
document.write(&quot;Navigation Bar<br />\n&quot;);
document.write(&quot;<img src=\&quot;myimage.gif\&quot;>&quot;);
--></script>

Just be careful about quotation marks (change them to \&quot; and you should be safe)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top