0

It's been a while since I've done anything resembling web development, and I'm trying to get this small snippet of code to work in IE8.

<head>
    <script src="http://code.jquery.com/jquery-1.11.3.min.js"></script>
</head>

<body>
    <input type='submit' id='submit_button'>

    <script>
        $('#submit_button').click(function(data) {
            var query = 'http://data.cityofchicago.org/resource/ydr8-5enu.json';
            $.get(query, function(data){
                alert('help please');
            });
        });
    </script>
</body>

I get the json and the alert pops up fine in Chrome, but when I attempt to run it in IE8 nothing happens. I set up a breakpoint in the IE8 dev tools and I can see that the query variable is being initialized and the get function is being called, but the callback isn't.

I can't see any error messages anywhere in IE8's dev tools, and I don't see any place to inspect network traffic. I might just be missing them however, I find it really hard to navigate. If I use Fiddler I can't see any requests or responses when the get method fires, but I do see them when I use Chrome.

I've looked at similar questions and they mostly seem to involve missing semicolons, which I think I have covered, or cross-domain requests, which I think would have broke Chrome as well. So I'm a little stumped.

all_ice
  • 65
  • 1
  • 6

1 Answers1

0

If the code you've quoted in the question is complete, then you're missing the <html> and </html> tags and the doctype.

Missing these out will cause IE to jump into quirks mode, which will pretty much kill any hope of jQuery working properly (or most other modern JS code) for that matter.

Fix that, and things should start working better.

Spudley
  • 166,037
  • 39
  • 233
  • 307