0

I'm using $.getJSON to append Google Sheets data to my HTML document. The data flows in on all browsers except Internet Explorer and I'm not sure why. I've read other threads on the issue but can't figure out a solution – my problem seems to be a little different because of the appending. Any help would be appreciated!

Specifics: I'm using jQuery v2.1.3 and when I try to load the page in Internet Explorer through Browserling, this is the error message that pops up –

Exception in window.onload: Error: An error has occurredJSPlugin.3005

Here's the specific script I'm using:

var profile = $('#profile');
    $().ready(getSchool);

    function getSchool() {
        $.getJSON('https://spreadsheets.google.com/feeds/list/1t_k4uQt04StZqiGqcoBAti5xauCtOr0_pT4FCtV8mTQ/1/public/values?alt=json')
            .done(function(data) {
                var arr = Array.from(data.feed.entry);
                profile.html('');
                arr.forEach(function(e) {
                    var info = `HTML GOES HERE`
                    profile.append(info);
                })
            })
            .fail(function() {
                alert('Error retrieving school data');
            })
    }
Nick D
  • 25
  • 5
  • `$.getJSON has a tendency to cache results in IE. Use $.ajax instead.` – Alex Jul 09 '18 at 15:53
  • are there any errors that you can see? – John Kane Jul 09 '18 at 15:53
  • Possible duplicate of [$.getJSON not workin in IE](https://stackoverflow.com/questions/10315211/getjson-not-workin-in-ie) – Alex Jul 09 '18 at 15:53
  • @JohnKane I added the error into the post. But I have to use an emulated Internet Explorer through Browserling so I'm not sure how informative that is. – Nick D Jul 09 '18 at 16:04
  • @Alex I haven't used ajax before (or getJSON for that matter) but I'll try to switch it over to that. Thanks for the suggestion. – Nick D Jul 09 '18 at 16:05
  • @NickD It's literally the same thing, just a different wrapper. Here's a good reference for you: [`How To Use JQuery’s $.Ajax() Function`](https://www.sitepoint.com/use-jquerys-ajax-function/) – Alex Jul 09 '18 at 16:08
  • 1
    @Alex Thanks! I'll check that out and try to switch it over – appreciate it. – Nick D Jul 09 '18 at 16:12

0 Answers0