Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6
  1. #1
    New to the CF scene
    Join Date
    Aug 2012
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    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

  • #2
    Senior Coder
    Join Date
    Sep 2010
    Posts
    2,050
    Thanks
    15
    Thanked 241 Times in 241 Posts
    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.

  • #3
    New to the CF scene
    Join Date
    Aug 2012
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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

  • #4
    Senior Coder jerry62704's Avatar
    Join Date
    Oct 2007
    Location
    Springfield, IL
    Posts
    1,100
    Thanks
    13
    Thanked 87 Times in 87 Posts
    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

  • #5
    New to the CF scene
    Join Date
    Aug 2012
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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

  • #6
    Senior Coder DanInMa's Avatar
    Join Date
    Nov 2010
    Location
    Salem,Ma
    Posts
    1,577
    Thanks
    13
    Thanked 248 Times in 248 Posts
    couldnt he do an echo to a script and css block so he doesnt have to change the css and js file to .txt?


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •