English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

I am making web site with the menu on the left side,it contain about 50 items.(Links to 50 pages). Is it any way I can create one page or some kind include file in javascript? So if I have to make changes to these items I can only change one main page with the menu and it will automatically update all 50 pages and I don't have to go to every 50 pages and change it ? I have it in html tables. If I can do it what should I change?I can only use javascript or java with that free hosting.

2007-02-14 13:49:28 · 4 answers · asked by Nata 1 in Computers & Internet Programming & Design

4 answers

You've seen a couple of cheesy (but they may work) methods...

most people use server side includes... but it doesn't look like your server can do that, (although many actually can)

some people resort to using frames, 1 frame has the navigation in it and the other has the content that changes.

I prefer ajax! with a simple ajax call I can bring in the nav and slip it right into the page... as if it was always there!

ajax is 21st century javascript, the others date back to the 90's.

I use http://jquery.com , and I can do that code in 1 line of jquery javascript!

basically:
$("#nav").load("nav.html")

2007-02-14 14:26:36 · answer #1 · answered by jake cigar™ is retired 7 · 0 0

The hash/pound image has no particular which means community to JavaScript. in this context, it is getting used to mark a difficulty that grow to be designed into the documents-variety that your preload function expects. The programmer and information-clothier agreed to that having the hash image in the first position of particular documents aspects would aspect out a particular state to the function. for this reason, if the # is NOTt the first personality in a string merchandise, then this methodology believes it to be the URL of a picture report. this means using a blended datastructure (MM_preload.... - regardless of that call refers to) of a few type with particular characters used to mark particular kinds of documents products. Pre-loading pictures is a common practice. It improves the consumer adventure through to make sure that all pictures which will be used are easily accessible in the previous they are referenced through a function. i don't understand what you advise through "the # image looks on the top of regardless of I type."

2016-12-04 04:52:06 · answer #2 · answered by Anonymous · 0 0

checkout this page: http://www.calstatela.edu/its/template/jsmenu.htm

to simplify it, you create an external js file that contains many document.write statements

document.write('Menu Link 1
');
document.write('Menu Link 2
');

2007-02-14 14:01:50 · answer #3 · answered by BigJohnny 4 · 0 1

write all your javascript in a file called "menu.js"


include the javascript in this fashion:

2007-02-14 13:56:44 · answer #4 · answered by Anonymous · 0 1

fedest.com, questions and answers