This is a discussion on "js include" within the JavaScript Forum section. This forum, and the thread "js include are both part of the Program Your Website category.
|
|
|
|
|
![]() |
||
js include
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
|||
|
js include
I'm sorry guys but I can't find a decent js include tutorial on google. Can somebody help me or give me code of how to use them for menus that you might want to change? Thanks.
|
|
|
|
|||
|
Re: js include
If you mean you want to have your menu html in a seperate file and included it on each of your pages, this has nothing to do with javascript. This is a server side function. You need to be using something like a php include or ssi (server side include) code. |
|
|||
|
Re: js include
ok, i'll take your word for it, but other people have suggested js include.
thanks |
|
||||
|
Re: js include
wahey! hold up matey...
Please be a bit more specific than "js include". What are you trying to include? JS code or HTML or both? If a server side include will add loads of JS script to your page then that's not the way to go... To "include" a client-side JS script file you should use: <script src="blah-di-blah.js" etc...
Last Blog Entry: Random String in Javascript (Apr 21st, 2008)
|
|
|||
|
Re: js include
I want to be able to change a constant site-wide menu, just by changing one file, so that I don't have to change it on each and every page.
Capiche? |
|
||||
|
Re: js include
Well, the point I'm getting at is:
Your menu: is it hard coded HTML or do you have a javascript which dynamically populates the menu? If the menu is created on the client (ie.: JScript dynamically generates HTML) then you need to use: <script src="blah-di-blah.js" etc... (PS.: You shouldn't use JScript for this) If not, just got ahead and use server side includes... I was just making sure
Last Blog Entry: Random String in Javascript (Apr 21st, 2008)
|
![]() |
| Tags |
| include |
| Thread Tools | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| @include() conundrum | CloudedVision | PHP Forum | 3 | Feb 15th, 2008 03:38 |
| include problem | alexgeek | PHP Forum | 11 | Aug 8th, 2007 14:14 |
| Can I use #include within an If Then statement? | Donny Bahama | Classic ASP | 5 | Jul 30th, 2006 18:29 |
| JS include | timmytots | JavaScript Forum | 5 | Jun 16th, 2006 01:49 |
| Help need with php include!! | allstar | PHP Forum | 7 | Dec 29th, 2005 15:09 |