Page 1 of 2 12 LastLast
Results 1 to 10 of 15

Thread: IE Not Reading .js File

  1. #1
    Join Date
    Jan 2005
    Posts
    14
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default IE Not Reading .js File

    On my website -- http://baerwcb.tripod.com/ -- you will see that I call my navigation with a JavaScript file. It works fine in Firefox (not a surprise), but IE just doesn't want to read it for some reason. I've been troubleshooting this problem for about a month and a half and have come up empty. Perhaps a fresh mind could help me out.

    Also, is there any fix to push my body content up in line with the navigation bar in IE? It's fine in Firefox, but it's down a bit in IE.

    Here are some screenshots so you see what my problem is:

    Firefox:



    Internet Explorer:



    The JS file can be found here: http://baerwcb.tripod.com/nav.js

    Thanks for your time.

  2. #2
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    It doesn't work in Opera either. The problem is these spaces around the equals (=) symbol:
    Code:
    <script type="text/javascript" src_=_"http://baerwcb.tripod.com/nav.js"></script>
    This illustrates another problem, though: browsers without Javascript enabled cannot navigate around your site. You need to rethink your script design.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends franšais | entiendo espa˝ol | t˘i Ýt hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  3. #3
    Join Date
    Jul 2006
    Location
    Canada
    Posts
    2,581
    Thanks
    13
    Thanked 28 Times in 28 Posts

    Default

    And handheld devices
    - Mike

  4. #4
    Join Date
    Jan 2005
    Posts
    14
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Well, it's just a "blog," though I don't like to refer to it as one. If I was running a business, I'd definitely make it extremely user-friendly.

    I removed the spaces and it still doesn't want to read it. Any other ideas?

  5. #5
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    Wow, for once IE's doing something right and Firefox is being too lenient.
    It's this trailing comma:
    Code:
    var linkData = {"Home":"index",
    "Sports":"sports",
    "Politics":"politics",
    "Graphics":"graphics",
    };
    Well, if you don't have anything worth reading, I guess you don't have to worry about people not being able to read it. Why even bother fixing the script error? You're restricting your viewers anyway.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends franšais | entiendo espa˝ol | t˘i Ýt hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  6. #6
    Join Date
    Jul 2006
    Location
    Canada
    Posts
    2,581
    Thanks
    13
    Thanked 28 Times in 28 Posts

    Default

    Ya' know.. I figured it would be easier to make a menu in HTML. In JavaScript, it sounds twice as hard (not necessaril hard, as much unnecessary work )
    - Mike

  7. #7
    Join Date
    Jan 2005
    Posts
    14
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    I made it in JavaScript so it would be easy to change my menu should I ever want to add, remove, or edit anything. If I do it via HTML, I have to go through each of my pages (between 75-100) and change it.

    Thanks for the help.

    Any idea on how I can get IE to put the body of my page in the same way Firefox does?

    IE still acts up a bit when you click on the links in the menu... it makes it green for some reason.

  8. #8
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    I made it in JavaScript so it would be easy to change my menu should I ever want to add, remove, or edit anything.
    I see you're using a host that doesn't support server-side scripting. This would definitely be the best way of doing this. Since you lack it, you have two options:
    1. Use an iframe for the menu.
    2. Create an index page with a list of all the links in the navigation menu, which you update when you update the menu. Have a plain HTML link on each in the navigation area, which you hide with Javascript.
    Any idea on how I can get IE to put the body of my page in the same way Firefox does?
    Find out what's causing the gap and remove it. It's probably a margin on one of the elements around that area.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends franšais | entiendo espa˝ol | t˘i Ýt hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  9. #9
    Join Date
    Jan 2005
    Posts
    14
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by Twey
    I see you're using a host that doesn't support server-side scripting. This would definitely be the best way of doing this. Since you lack it, you have two options:
    1. Use an iframe for the menu.
    2. Create an index page with a list of all the links in the navigation menu, which you update when you update the menu. Have a plain HTML link on each in the navigation area, which you hide with Javascript.
    Find out what's causing the gap and remove it. It's probably a margin on one of the elements around that area.
    Doesn't an iframe have scrollbars and borders, though? It would look weird in a navigation bar.

    I don't understand what you mean with #2.

    As for the IE gap, if I change something in my CSS (where the margins are set), it will change it in Firefox. If it's right in one, it's wrong in the other. Is there a way I can set it one way in IE and another way in Firefox, perhaps?

    Again, thanks for the help, it's much appreciated.

  10. #10
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    Doesn't an iframe have scrollbars and borders, though? It would look weird in a navigation bar.
    It doesn't have to. You can style it, like any other element.
    I don't understand what you mean with #2.
    Have a separate HTML page, with all the links that are in the menu. Then, on your pages in the navigation area, have a plain HTML link to that page, saying, for example, "site map." Hide this link (by setting display:none) using Javascript, so that only people with non-Javascript browsers will see it.
    As for the IE gap, if I change something in my CSS (where the margins are set), it will change it in Firefox. If it's right in one, it's wrong in the other. Is there a way I can set it one way in IE and another way in Firefox, perhaps?
    There are a few. The best is to use conditional comments. See MSDN and QuirksMode for details.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends franšais | entiendo espa˝ol | t˘i Ýt hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

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
  •