📨 Have you signed up to the Forum's new Email Digest yet? Get a selection of trending threads sent straight to your inbox daily, weekly or monthly!

Javascript Issue on IE

Hello,

I have a website that has some javascript on it, this works fine in Chrome, Opera, Safari and Firefox but not IE (any version I've tried).

I've installed Firebug to try to help debug it but that doesn't pick up any issues.

I'm not very good when it comes to javascript so would appreciate any assistance.

The page with the javascript is here:

http://www.fantasy-f1-league.com/team3.php

You will need to login, please use these details:

user: test
pw: test

The javascript is supposed to update the "Remaining Budget" as you choose options from the dropdowns, it also does a few other things such as prevents submission of invalid team selections.

Thanks for any assistance.

David
:A

Comments

  • The problem is the page is being forced into IE Quirks mode which is causing the javascript to not get called. You should be able to force it to use Standards mode using a meta tag.
    Just add <meta http-equiv=“X-UA-Compatible” content=“IE=EmulateIE8” /> as the first meta tag immediately after <head> (meta tags should always go immediately after the <head> tag, so you should have <head><meta><title>etc).
    Have a quick read of this and this

    Also, if you're using IE8 or IE9 press F12 to open the developer tools (similar to Firebug)
  • davidjwest
    davidjwest Posts: 756 Forumite
    edited 5 January 2012 at 10:41AM
    Thanks for the advice, it is much appreciated but the problem is still persisting after adding that meta tag. I've had the problem for a while and originally wrote a non-javascript page but it's now a pain having to maintain two separate scripts, I think I tested it using IE6 last year and that had the same issue.

    Using IE9, good tip about the F12 developer tool, but that isn't reporting any errors.

    It looks like IE simply ignores the javascript for some reason, I have no clue as to why.

    Thanks again.
    :A
  • bigdave196
    bigdave196 Posts: 134
    Ninth Anniversary Combo Breaker
    Forumite
    edited 5 January 2012 at 11:48AM
    Try changing content="IE=EmulateIE8" to either content="IE=9" or content="IE=edge", that should tell IE to use the highest mode it can.
    When I change the Document Mode in the dev tool to IE9 standards it works fine

    EDIT: only use IE=edge for testing, don't leave it in when you release :)
  • davidjwest
    davidjwest Posts: 756 Forumite
    edited 5 January 2012 at 12:41PM
    Many, many thanks, I got it working (at least on my browser, IE9) by changing it thus:

    <meta http-equiv='X-UA-Compatible' content='IE=8' />

    Would appreciate it if anyone using any other versions of IE can give it a go, I assume it will be fine in IE8 and anything before IE7 I can ignore as there's nobody using that any more according to my webstats.

    Any IE7 users can try it please?

    Funnily enough the "edge" option didn't work, but I'm not too worried about that, just thought I'd post that for info.

    Many thanks again bigdave196, you have saved me hours more pain!

    :)
    :A
  • bigdave196
    bigdave196 Posts: 134
    Ninth Anniversary Combo Breaker
    Forumite
    No worries, IE can be a right royal pain for odd little bugs like this, but at least they're slowly slowly improving with every version
This discussion has been closed.
★ ★ ★ Meet your Ambassadors

🚀 Getting Started

Hi new member!

Our Getting Started Guide will help you get the most out of the Forum

Categories

  • All Categories
  • 356K Banking & Borrowing
  • 255K Reduce Debt & Boost Income
  • 456.3K Spending & Discounts
  • 248.5K Work, Benefits & Business
  • 606.2K Mortgages, Homes & Bills
  • 179.1K Life & Family
  • 264K Travel & Transport
  • 1.5M Hobbies & Leisure
  • 16.2K Discuss & Feedback
  • 37.7K Read-Only Boards
Quick Search

Is this how you want to be seen?

We see you are using a default avatar. It takes only a few seconds to pick a picture.