![]() |
Linking html pages to the left nav menu options
I have created a .js file for left nav manu/sidebar.
I am calling this .js file in my .html page so that i dont have to write the code for left menu in each page. Now if i click on any other link the new html file opens.but i am not able to apply the classes for nav menu on load. Below is my code: In my html page i have included this code Code:
$(document).ready(function () {in body tag i have written code for left nav menu: Code:
<!-- sidebar -->Code:
document.write("<!-- sidebar -->"+ |
Oh my, this is a terrible way to do it. Why don’t you create your entire website with JS so that people without JS enabled/available see nothing at all?
Seriously, you should look into Server Side Includes (also available in PHP and other languages). |
this is clients requirement...i cant make any changes in it
|
What exactly is the client’s requirement? That you create a menu entirely with JavaScript and insert it with
document.write()? |
| All times are GMT +1. The time now is 09:46 PM. |
Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.