【问题标题】:jQuery get Method problem using IE使用 IE 的 jQuery 获取方法问题
【发布时间】:2010-10-10 11:12:22
【问题描述】:

我使用 HTML、CSS 和 jQuery 创建了一个小型照片导览。在 Firefox 和其他浏览器中运行良好,但在 IE 中存在一些问题。

这是我用来加载数据的代码:

function loadNode(nodeID){
jQuery('.churchViewError').hide('slow');
    jQuery(".churchViewLoading").show( 'fast');
    jQuery.get(cVBaseURL+"ajax/getNodeHTML.php?node="+nodeID, 
        function(data, status, XMLHTTPRequest){
            //someone suggested empty() might help in IE - won't fix it, though
            jQuery("#churchViewInner").empty(); 
            jQuery("#churchViewInner").html(data);
            jQuery(".churchViewLoading").hide('slow');
        }
        , 'html');

}

在firefox中,新的内容(主要是几个img和a-Tags)可以正常显示,但是IE只显示一个空的div。使用

alert(jQuery("#churchViewInner").html());

在 get-Method 显示之后,即使在 IE 中,新内容似乎也存储在 DOM 中。看来 IE 并不想实际加载/显示图像。 (在 IE 8 中测试)

有没有人知道如何让它在 IE 中运行?

这是原文:http://www.minis-friskus.de/churchview/(德语网站)点击红色按钮开始。

【问题讨论】:

    标签: jquery ajax image internet-explorer get


    【解决方案1】:

    您的回复有一些 IE 可能不喜欢的额外结束标签,您的回复如下所示:

    <div class="churchViewImage">           <img src="http://www.deviala.de/friskus/wp-content/plugins/friskusChurchView/img/nodes/IMG_0005.JPG">       </div>      <div class="arrow" style="left:282px; top: 348px; z-index: 3;">         <a href="#churchViewContainer" onclick="loadNode('2');">                <img src="http://www.deviala.de/friskus/wp-content/plugins/friskusChurchView/img/arrows/north.png">         </a>        </div>  </div></div>
    

    注意末尾多余的&lt;/div&gt;&lt;/div&gt;,尝试删除它以获得有效标记,然后查看 IE 的作用。

    【讨论】:

    • thx - 我专注于 js 问题,而不是 html 语法错误 :)
    猜你喜欢
    • 2020-12-04
    • 2011-04-24
    • 2011-06-25
    • 1970-01-01
    • 2022-07-04
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-09-02
    相关资源
    最近更新 更多