我正在整理一个网站(www.pickmixmagazine.com/wordpress),我有一个功能可以点击其中一个大方块,数据被加载到滑动 iframe 中(试试看!)我正在尝试从服务器使用 ajax 并将数据写入 iframe,如下所示。它在 Firefox 和 chrome 中完美运行,只是在 IE 中我不断收到错误“$”未定义,我无法访问任何 Jquery。这是代码(我只包含了函数的ajax部分):
function changeFrame(i)
    {
        var elm = parent.document.getElementsByTagName('iframe')[0];
        var topval = $(elm).css('top');
        if(i!='' && i!='home' && window.top==window.self){
            //$('iframe.primary').attr('src', 'http://www.pickmixmagazine.com/wordpress/'+i);
            var ifrm = document.getElementById("mainframe")
            ifrm = (ifrm.contentWindow) ? ifrm.contentWindow : (ifrm.contentDocument.document) ? ifrm.contentDocument.document : ifrm.contentDocument;
            //var doc = w.document.documentElement;
            //w.contentWindow.location.replace('http://www.pickmixmagazine.com/wordpress/'+i);
            var xhr = $.ajax({
                    url: 'http://www.pickmixmagazine.com/wordpress/'+i,
                    success: function(data) {
                      ifrm.document.open();
                       ifrm.document.write(data);
                       ifrm.document.close();  
谢谢你的帮助!