js include

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.



Go Back   Webforumz.com > Main Forums > Program Your Website > JavaScript Forum

Notices


Reply
 
LinkBack Thread Tools
  #1 (permalink)  
Old Jul 7th, 2006, 13:13
SuperMember

SuperMember
Join Date: Nov 2005
Location: England
Age: 27
Posts: 308
Thanks: 1
Thanked 0 Times in 0 Posts
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.
Reply With Quote

  #2 (permalink)  
Old Jul 7th, 2006, 18:09
Most Reputable Member
Join Date: Apr 2006
Location: Cornwall, UK
Posts: 1,310
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Skype™ to ukgeoff
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.
Reply With Quote
  #3 (permalink)  
Old Jul 7th, 2006, 21:37
SuperMember

SuperMember
Join Date: Nov 2005
Location: England
Age: 27
Posts: 308
Thanks: 1
Thanked 0 Times in 0 Posts
Re: js include

ok, i'll take your word for it, but other people have suggested js include.

thanks
Reply With Quote
  #4 (permalink)  
Old Jul 8th, 2006, 09:35
spinal007's Avatar
Moderator
Join Date: Mar 2004
Location: Good Ol'London
Age: 22
Posts: 1,620
Blog Entries: 1
Thanks: 0
Thanked 2 Times in 2 Posts
Send a message via ICQ to spinal007 Send a message via MSN to spinal007 Send a message via Yahoo to spinal007 Send a message via Skype™ to spinal007
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)
Reply With Quote
  #5 (permalink)  
Old Jul 8th, 2006, 10:12
SuperMember

SuperMember
Join Date: Nov 2005
Location: England
Age: 27
Posts: 308
Thanks: 1
Thanked 0 Times in 0 Posts
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?
Reply With Quote
  #6 (permalink)  
Old Jul 8th, 2006, 12:43
spinal007's Avatar
Moderator
Join Date: Mar 2004
Location: Good Ol'London
Age: 22
Posts: 1,620
Blog Entries: 1
Thanks: 0
Thanked 2 Times in 2 Posts
Send a message via ICQ to spinal007 Send a message via MSN to spinal007 Send a message via Yahoo to spinal007 Send a message via Skype™ to spinal007
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)
Reply With Quote
Reply

Tags
include

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

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


All times are GMT. The time now is 04:45.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43