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

Thread: Problem with IE 7 & JavaScript code

  1. #1
    Join Date
    Aug 2007
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Problem with IE 7 & JavaScript code

    I am assisting a friend who is a photographer to build her website and we are using a code from one of her professor's sites as the basis for her menu. The problem I am having is that the menu is not displaying properly using IE 7. I have not noticed any problems with Mozilla or IE 6. The problem is that the names do not line up with the drop down area when using IE 7 and I am unsure where the error might be.

    Can anyone help me?

    The site is http://www.photosbyjlynn.com/test/main.html

    Just take a look at the source code there and if you have any ideas I would love the help.

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    The easiest road home would be to throw all browsers into quirks mode by removing your DOCTYPE, as it looks like that is (for the most part) how the markup and code was intended to be rendered.

    In other words, get rid of this:

    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    Replace it with:

    Code:
    <html>
    There are other ways, probably even (though not necessarily) better ways, but that is most likely the easiest.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

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

    Default

    Doing so, unfortunately, should remove any hopes of having future-proof or cross-browser code you may entertain.
    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!

  4. #4
    Join Date
    May 2006
    Location
    Sydney, Australia - Near the coast.
    Posts
    1,995
    Thanks
    0
    Thanked 8 Times in 7 Posts

    Default

    Or, you could add a comment tag right before the doctype, so it forces IE into Quirks Mode. (Though I'm not sure if this works in IE7)

    Code:
    <!-- Quirks Mode for IE - Dump IE now! -->
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    Peter - alotofstuffhere[dot]com - Email Me - Donate via PayPal - Got spare hardware? Donate 'em to me :) Just send me a PM.
    Currently: enjoying the early holidays :)
    Read before posting: FAQ | What you CAN'T do with JavaScript | Form Rules | Thread Title Naming Guide

  5. #5
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Quote Originally Posted by Twey View Post
    Doing so, unfortunately, should remove any hopes of having future-proof or cross-browser code you may entertain.
    Did you see the code? It's all tag soup and outdated javascript. 'Abandon all hope, Ye who enter here'.

    Quote Originally Posted by tech_support View Post
    Or, you could add a comment tag right before the doctype, so it forces IE into Quirks Mode. (Though I'm not sure if this works in IE7)

    Code:
    <!-- Quirks Mode for IE - Dump IE now! -->
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    That does appear to (in limited testing here, just now) still do it in IE 7.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  6. #6
    Join Date
    Aug 2007
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    I can't lie. I am not suprised it is tag soup. I am by far and wide an amatuer at coding. Thank you all for the ideas and if you think of anything else please dont hesitate to let me know. I will try the ideas as soon as I am back at my testing setup. Again, I appreciate the help alot.

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

    Default

    The validator would be a good starting point to fixing your pages. Aim for HTML 4.01 Strict.
    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!

  8. #8
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Quote Originally Posted by Twey View Post
    The validator would be a good starting point to fixing your pages. Aim for HTML 4.01 Strict.
    That is one very good way to get started toward understanding and implementing good standards compliant cross browser code. But, it isn't a simple process, no matter how one goes about it.

    That fact is no reason not to pursue such a goal. I think Twey and I, as well as others would be willing to help along the way by answering specific questions toward that end.

    I would like to add that I had my tongue in my cheek when I typed:

    'Abandon all hope, Ye who enter here'.
    For two reasons - code like that, or at least not too dissimilar than that could stand the test of time, and (somewhat conversely) no matter how bad the code is, there is no reason why it couldn't be made standards compliant, should you choose to do so and applied yourself to that objective.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  9. #9
    Join Date
    Aug 2007
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Ok so I chose HTML 4.01 Transitional and have gone through the code to fix it up a bit. I have tested it on Firefox and so far it looks fine in IE to me. Will you guys please give it a run through and see if you find anything? I would really appreciate the help.

    Ok I did some more editing to clean up a bit of code and found that if I remove the doctype I get the results I want from the top. The rest of the document is html 4.01 transitional validated except that part. Any ideas?

    Newt
    Last edited by andernew; 08-27-2007 at 07:50 AM.

  10. #10
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Quote Originally Posted by w3c validator
    DOCTYPE Override in effect!

    The DOCTYPE Declaration for "HTML 4.01 Transitional" has been inserted at the start of the document, but even if no errors are shown below the document will not be Valid until you add the new DOCTYPE Declaration.
    With that, it would be valid HTML 4.01 Transitional. There are some problems. In FF use:

    tools > error console

    to see some suggestions.

    You can also view this page (css validator):

    http://jigsaw.w3.org/css-validator/v...st%2Fmain.html
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

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
  •