Go Back   CodingForums.com > :: Client side development > General web building

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 08-22-2012, 02:55 PM   PM User | #1
ShamAce
New to the CF scene

 
Join Date: Aug 2012
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
ShamAce is an unknown quantity at this point
Repeat Jquery navbar on multiple pages

I am rebuilding a site, replacing Flash navigation with Jquery/CSS/HTML5.

I am getting fluent in the scripting, but this may be a dumb newbie question: Once I write my navbar script, how do I call it on each page? I want to be able to change all pages simultaneously should I need to add a link, let's say.

I do not want to use PHP, which would require a new learning curve.

I'd appreciate any help. Direct email is fine.

Shamace
ShamAce is offline   Reply With Quote
Old 08-22-2012, 03:37 PM   PM User | #2
DrDOS
Senior Coder

 
Join Date: Sep 2010
Posts: 1,155
Thanks: 10
Thanked 148 Times in 148 Posts
DrDOS is infamous around these parts
Actually if you have php on your website it will be very easy to use it. Here is all the 'learning curve' you need. If your navbar is 'fixed' code, that is, it has no php variables of any kind, and can be written as a plain text file, even if it includes javascript and css, just name it navbar.txt and put this where you want to locate it on a page:
PHP Code:
<?php include("navbar.txt"); ?>
Of course you need to give the correct path. php will just write the text verbatim to the page, and it will need to be done for every page.
DrDOS is offline   Reply With Quote
Old 01-28-2013, 03:01 PM   PM User | #3
ShamAce
New to the CF scene

 
Join Date: Aug 2012
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
ShamAce is an unknown quantity at this point
Quote:
Originally Posted by DrDOS View Post
Actually if you have php on your website it will be very easy to use it. Here is all the 'learning curve' you need. If your navbar is 'fixed' code, that is, it has no php variables of any kind, and can be written as a plain text file, even if it includes javascript and css, just name it navbar.txt and put this where you want to locate it on a page:
PHP Code:
<?php include("navbar.txt"); ?>
Of course you need to give the correct path. php will just write the text verbatim to the page, and it will need to be done for every page.
This works fine, but the inserted content appears without any of the CSS or JQ applied to it.

If I give you the main page in html, can you help me build one .php page. I will pay.

tim in pa
ShamAce is offline   Reply With Quote
Old 01-28-2013, 04:43 PM   PM User | #4
jerry62704
Senior Coder

 
jerry62704's Avatar
 
Join Date: Oct 2007
Location: Springfield, IL
Posts: 1,046
Thanks: 9
Thanked 81 Times in 81 Posts
jerry62704 is on a distinguished road
Make the css is included (or make it a PHP include) on each page. You are using a separate file for the css?
__________________
.
.
...and gladly would he learn and gladly teach

Visit www.LiberalsWin.com for humor and the unique Bush/Obama Approval Polls
jerry62704 is offline   Reply With Quote
Old 01-28-2013, 05:08 PM   PM User | #5
ShamAce
New to the CF scene

 
Join Date: Aug 2012
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
ShamAce is an unknown quantity at this point
Quote:
Originally Posted by jerry62704 View Post
Make the css is included (or make it a PHP include) on each page. You are using a separate file for the css?
Yes, I am using a separate file for css and jq. how do I include (or call) them on a .txt page?

Thanks,

ace
ShamAce is offline   Reply With Quote
Old 01-28-2013, 07:39 PM   PM User | #6
DanInMa
Senior Coder

 
DanInMa's Avatar
 
Join Date: Nov 2010
Location: Salem,Ma
Posts: 1,307
Thanks: 12
Thanked 204 Times in 204 Posts
DanInMa is on a distinguished road
couldnt he do an echo to a script and css block so he doesnt have to change the css and js file to .txt?
__________________
- Firebug is a web developers best friend! - Learn it, Love it, use it!
- Validate your code! - JQ/JS troubleshooting
- Using jQuery with Other Libraries - Jslint for Jquery/other JS library users
DanInMa is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

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

Forum Jump


All times are GMT +1. The time now is 06:58 AM.


Advertisement
Log in to turn off these ads.