Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Navigation bar in javascript?

Featured Replies

Hello. First post. Be gentle with me. :D

 

I've been converting my almost wholly HTML website to a CSS layout. Currently, the site uses frames to form a side navigation bar. This is good because it means I only need to edit this one frame when I add to the site. Replacing frames with CSS however, and the code for the navigation bar has to be within each page, hence, losing that flexibility.

 

Question is, is there a way to have CSS layouts while retaining the flexibility of frames? Does the answer lie in javascript? I know very little about javascript; only just got around to learning CSS. Can javascript replicate very basic HTML tags?

 

So for example, is there a direct javascript equivalent of this?:

 

<ol>
<li><a href="page1.html">Page 1</a></li>
<li><a href="page2.html">Page 2</a></li>
</ol>

 

Any advise appreciated.

 

Wayne

Use php and "includes"

  • Author
Use php and "includes"

 

Ahh! Well I know even less about PHP than I do javascript, but at least it points me in the right direction. I guess I'll head over to Google and try to find me an idiot's guide.

 

Thanks.

 

Wayne

Includes were the first thing I learnt about php. They're not as hard as you think and make large sites so nice and easy to edit. To be honest I've never even used a frame, no need (for what you want) really.

what does php do anyway ? .. i only know html and css currently .. and some java scripts..

You can use includes in an HTML page. Save the file as .shtml so that server knows to parse it gets sent.

 

This site explains in more detail.

 

Hope it helps

I wouldn't use a javascript nav bar as some people don't have javascript enable in the browser and, therefore, won't be able to get around your site. You should use something simple like a css nav bar.

 

Here are some copy-paste css codes of vertical and horizontal nav bars CSS Nav Bars

^ I agree a CSS based navigation would be much better than javascript one. You can then use an include to put it on you page so that it can be amended easily.

  • Author

It's okay, I'd already done a CSS nav bar, and I've now added a php include. So sorted!

 

The only small downside is doing this has now precluded me from continuing to have my site backed up on my ISP personal webspace, because they don't support php. But no big deal.

 

Thanks for all the advise anyway.

 

Wayne

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.