SitePoint Sponsor

User Tag List

Results 1 to 10 of 10
  1. #1
    SitePoint Member
    Join Date
    Oct 2000
    Posts
    6
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'm working on a large site (over 3,000 pages) and would like to have my navigation handled through dropdown menus. I've used several java script solutions that are nice, but don't meet all of my requirements.

    To make it possible to update this large site easily I'd like to place the javascript files in the root of my server, and use SSI to write to each HTML file to build the menus. Each HTML file that uses these files would simply use <!-- virtual include> and call the js by a URL, such as http://www.hss.state.ak.us/js/filename.js.

    So far I've found one JS solution that works this way, but only has one level of submenus, but I need two. All of the solutions that I've found with 2 levels require that the js file be in the directory with the HTML.

    Am I missing something basic, any suggestions?
    Peter Anderegg
    DHSS, State of Alaska
    (907) 465-8826

  2. #2
    Irritability Defined
    Join Date
    Jul 2000
    Location
    80,000 feet below the surface
    Posts
    1,442
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Geez, how did I miss this thread?!

    Peter, which dropdown menu system are you using? It really sounds like to me that there is something simple missing, due to the fact that the vast majority of the time the code behind the DHTML dropdown menus are encapsulated in one file only.

    *another thought* : can you show the full SSI command you're using? That may also be a cause.

    Good luck.
    My 2 Cents (or is that 2.2 Cents including GST?)

  3. #3
    SitePoint Addict SLeon's Avatar
    Join Date
    Sep 2000
    Location
    Northern California
    Posts
    222
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I have had no problem with using SSI to include JavaScript or DHTML files that are not within the same directory. So...I know it can be done...Have you looked at the scripts on Dynamic Drive? Lots of great DHTML there, and I got the top menu w/dropdowns that I use on my site, StrangePegs.com, there.
    InformationSavant - developing intelligent web business
    StrangePegs.com - collectible cards, games, toys, comics

  4. #4
    SitePoint Enthusiast Rips's Avatar
    Join Date
    Mar 2001
    Location
    London, UK
    Posts
    43
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    What's a better way of including JavaScript files using SSI or the src attribute of the <script> tag?

    I always thought it was best to use the src attribute, because the JavaScript file gets cached by the browser making the pages load more quickly.

    Are there any advantages with using SSI instead tho'?


  5. #5
    SitePoint Addict SLeon's Avatar
    Join Date
    Sep 2000
    Location
    Northern California
    Posts
    222
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Well, gosh, I dunno. I've done it both ways but have never tested it. Anyone know what is the best method, for reasons of efficiency or other? School me...
    InformationSavant - developing intelligent web business
    StrangePegs.com - collectible cards, games, toys, comics

  6. #6
    SitePoint Wizard creole's Avatar
    Join Date
    Oct 2000
    Location
    Nashvegas Baby!
    Posts
    7,845
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Peter...

    I use a program called dHTML Menu Builder. (http://software.xfx.net/utilities/dmbuilder/index.html)

    It only costs about $30 and it can handle multiple sub-levels. It works in Netscape and IE and it is RAD!

    It makes it so easy to build great cross-platform menus that you could pound it out in an hour or two. Plus you can specify whereever you want to JS file to go.

    Check it out. They have a demo you can preview. I do recommend that you get the BETA version of 3 though. Even though it is BETA, it works perferctly. I think it is within weeks of becoming a full release.
    Adobe Certified Coldfusion MX 7 Developer
    Adobe Certified Advanced Coldfusion MX Developer
    My Blog (new) | My Family | My Freelance | My Recipes

  7. #7
    SitePoint Enthusiast
    Join Date
    Mar 2001
    Location
    Madison, Wisconsin
    Posts
    42
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You would have the caching advantage if you used <script scr="/dropdown.js" language="javascript"></script>

    SSI is good in the event that a browser doesn't support scripting. But in your case (use of DHMTL), that seems to be beside the point.

    You could use both, acutally, with the SSI containing a <noscript>blah, blah.</noscript>

    doug

  8. #8
    SitePoint Addict SLeon's Avatar
    Join Date
    Sep 2000
    Location
    Northern California
    Posts
    222
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I just reworked the whole site to use the src attribute of <script> instead of including the JS with SSI. I don't really know whether it's made the pages load faster or anything. However, one cool thing is that on CGI and other template pages, I can now include the JS rather than having to cut and paste it over! So that's a really good thing.
    InformationSavant - developing intelligent web business
    StrangePegs.com - collectible cards, games, toys, comics

  9. #9
    SitePoint Enthusiast Rips's Avatar
    Join Date
    Mar 2001
    Location
    London, UK
    Posts
    43
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yeah using both SSI and the src attribute together is proper wicked.

    You can completly modularise your code. You can have all your server-side ASP or PHP logic included through SSI. And then have all the client-side JavaScript functions in a single .js file, rather than spread all over the place!


  10. #10
    SitePoint Member
    Join Date
    Oct 2000
    Posts
    6
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I started this thread with a simple question, and have really appreciated and learned from all of the posts. Turns out that my initial question, concerning using SSI to include a client side java script, was answered early on. As a result I've successfully used SSI to include both the .js file and the script for our pages. Haven't rolled it out yet, still in development, but I have been able to modify many pages at once by simply modifying the include file. Way Cool!

    Currently I'm working on using another menuing system that requires an image map that I have also been able to include with SSI.

    So, how about including an entire page? Any suggestions? On our intranet portal I'd like to embed an external page in a picture-in-picture style so that our users can get their fill of headlines, sports scores or whatever. I'm trying to avoid using frames for this.

    Keep those cards and letters coming...
    Peter Anderegg
    DHSS, State of Alaska
    (907) 465-8826


Bookmarks

Posting Permissions

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