SitePoint Sponsor

User Tag List

Results 1 to 8 of 8
  1. #1
    SitePoint Zealot
    Join Date
    Jul 2008
    Posts
    187
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    IE8 not recognizing jQuery statement?

    I started on this site a few weeks ago and had very clean, efficient code in place then before I could finish my life went haywire and the graphic designer took over and the code got largely out of my control. So when you look at it you'll see lots of quirky code things that aren't mine but I can't blame the designer for doing what they had to. And now I am back on the project just trying to get things wrapped up. Anyways... I am using jQuery to highlight current page links (there's a reason I'm not using PHP in this particular project) but IE8 doesn't seem to recognize the code. Any thoughts?

    http://brianleatart.com/clients.php

  2. #2
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    24,097
    Mentioned
    448 Post(s)
    Tagged
    8 Thread(s)
    This may or may not help, but it confuses browsers if you link to the JQuery library more than once. You should only have one link to it, but you have two links in your head (meaning double the massive download):

    Code:
    <script type="text/javascript" src="js/jquery.js"></script>
    ...        
    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js"></script>
    Remove one of those (I would get rid of the first one) and see if that helps.
    Facebook | Google+ | Twitter | Web Design Tips | Free Contact Form

    Forum Usage: Tips on posting code samples, images and more

    Forrest Gump: "IE is like a box of chocolates: you never know what you're gonna get."

  3. #3
    SitePoint Guru Jason__C's Avatar
    Join Date
    Oct 2009
    Location
    Racoon City
    Posts
    660
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Ever thought highlighting/styling with pure CSS, instead of using jQuery all together?
    Chuck Norris is so tough,
    mosquitos ask for permission before they bite him

  4. #4
    SitePoint Zealot
    Join Date
    Jul 2008
    Posts
    187
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by USPaperchaser View Post
    Ever thought highlighting/styling with pure CSS, instead of using jQuery all together?
    Can you highlight a current page link with just CSS?

  5. #5
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    24,097
    Mentioned
    448 Post(s)
    Tagged
    8 Thread(s)
    Quote Originally Posted by MauiMan2 View Post
    Can you highlight a current page link with just CSS?
    Yes indeed. Check out these threads:

    http://www.sitepoint.com/forums/show...ve-Page-in-CSS

    http://www.sitepoint.com/forums/show...ass-active-CSS
    Facebook | Google+ | Twitter | Web Design Tips | Free Contact Form

    Forum Usage: Tips on posting code samples, images and more

    Forrest Gump: "IE is like a box of chocolates: you never know what you're gonna get."

  6. #6
    SitePoint Zealot
    Join Date
    Jul 2008
    Posts
    187
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for the responses, everyone. I've got my own computer up and running now and am trying to get this fixed. I am trying to remove the multiple instances of jQuery. I removed one of the three and left two and things worked fine but when I tried to remove either instance of the remaining two things went kaflooey. Part of the problem, though probably not the whole problem, is that IE8- has problems with both of Google's CDN files included, and it has a different problem with each file. I thought we would be able to trust those things. If I was able to get one instance and one instance only of jQuery running it might solve the "highlight current link" problem. I have found out that IE8- is not recognizing at least certain instances of "$" or "jQuery" so there might be a conflict going on with some of the other scripts. If I had been the only one building the site I would've caught the conflict as soon as it came up. But now with so many scripts in place it is hard to locate the conflict.

  7. #7
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    24,097
    Mentioned
    448 Post(s)
    Tagged
    8 Thread(s)
    Quote Originally Posted by MauiMan2 View Post
    I removed one of the three and left two and things worked fine but when I tried to remove either instance of the remaining two things went kaflooey.
    Perhaps they are different versions, and one of the scripts depends on a later version. Having multiple links to the jQuery library is like running a new power cable into your house every time you want to add a new power point. Of course, you only need on electricity cable into your house to power the whole thing.

    Make sure that the one library link sits above any other jQuery scripts. As you say, it's tough with a lot going on in the page, but it may be worth stripping the scripts out and adding them back in one by one. Then you know where the problem starts. Also, I'd recommend putting all scripts at the bottom of the page (just before the closing <body> tag). It seems to cause problems if you have the jQuery library linked at the top of the page but other jQ scripts at the bottom of the page, so I prefer to keep them all together, and preferably at the bottom, as the page visually loads faster that way (I find, anyhow).
    Facebook | Google+ | Twitter | Web Design Tips | Free Contact Form

    Forum Usage: Tips on posting code samples, images and more

    Forrest Gump: "IE is like a box of chocolates: you never know what you're gonna get."

  8. #8
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    24,097
    Mentioned
    448 Post(s)
    Tagged
    8 Thread(s)
    Quote Originally Posted by FriedaTakaha View Post
    Ever thought highlighting/styling with pure CSS
    That's already been suggested in this thread. But it's a good suggestion.
    Facebook | Google+ | Twitter | Web Design Tips | Free Contact Form

    Forum Usage: Tips on posting code samples, images and more

    Forrest Gump: "IE is like a box of chocolates: you never know what you're gonna get."


Tags for this Thread

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
  •