首页 > 解决方案 > getJSON 不会在 IE 中附加数据

问题描述

我正在使用 $.getJSON 将 Google 表格数据附加到我的 HTML 文档中。数据流入除 Internet Explorer 之外的所有浏览器,我不知道为什么。我已经阅读了有关该问题的其他线程,但无法找到解决方案 - 由于附加,我的问题似乎有点不同。任何帮助,将不胜感激!

细节:我使用的是 jQuery v2.1.3,当我尝试通过 Browserling 在 Internet Explorer 中加载页面时,弹出的错误消息是 -</p>

window.onload 中的异常:错误:发生错误JSPlugin.3005

这是我正在使用的特定脚本:

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');
            })
    }

标签: javascriptjquerygoogle-sheetsappendgetjson

解决方案


推荐阅读