IE8(兼容模式)将不会加载我的Ajax内容 [英] IE8 (compatibility mode) won't load my Ajax content

查看:139
本文介绍了IE8(兼容模式)将不会加载我的Ajax内容的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在 http://www.qxl.dk/ 上的jQuery脚本似乎不能让IE7(或更准确地说,IE8在IE7兼容模式下)加载我的内容。

I am working on a jQuery script on http://www.qxl.dk/ and I can't seem to get IE7 (or more accurately, IE8 in IE7 compatibility mode) to load my content.

右侧的侧边栏名为QXL Aktuelt加载其HTML内容使用Ajax load()的外部文件,然后触发自定义jQuery事件( aktuelt_loaded )它启动了一个转盘脚本(如滚动的newsticker)。

The sidebar box on the right named "QXL Aktuelt" loads its HTML content from an external file using Ajax load(), then triggers a custom jQuery event ("aktuelt_loaded") that starts a carousel script (like a scrolling newsticker).

同一页面上的其他几个内容部分通过Ajax加载,它们工作正常,所以我想知道出了什么问题一切都符合Firefox 3.6和IE8中的预期,但IE8的兼容模式不是这样。

Several other content sections on the same page are loaded through Ajax and they work just fine, so I'm wondering what's going wrong. Everything works as expected in Firefox 3.6 and IE8, but not in IE8's compatibility mode.

加载Ajax内容的脚本是(在页面上的内联):

The script that loads the Ajax content is (inline on the page):

<div id="qxlaktueltHolder"></div>
<script type="text/javascript">
    $("#qxlaktueltHolder").load("/contents/dk/modul/qxlaktuelt/qxlaktuelt.htm", function() {
        $("#qxlaktueltHolder").trigger("qxlaktuelt_loaded", []);
    });
</script>
<script type='text/javascript' src='http://www.qxl.dk/contents/dk/js/jcarousellite_1.0.1.min.js'></script>
<script type='text/javascript' src='http://www.qxl.dk/contents/dk/js/qxlaktuelt_liveload.js'></script>

响应该事件的外部脚本位于以下文件中:

The external script that responds to the event is in the following file:

http://www.qxl.dk/ content / dk / js / qxlaktuelt_liveload.js

所有想法都非常受欢迎。

All ideas are very welcome.

推荐答案

编辑:

看起来您的内容正在加载。你似乎有一个CSS显示问题。使用IE的开发工具,我搜索了一个 a 的href,该文件在Safari中正确加载。

Looks like your content is being loaded. You seem to have a CSS display issue. Using IE's developer tools, I searched for the href of an a that was loaded properly in Safari

http://www.123hjemmeside.dk/pages/receive.aspx?target=wl&partnerkey=dkqxl:Hobby_aktuelt_1

并发现是在页面上以及所有其他内容。

and found that is was on the page along with all the other content.

更新:

问题在于您的 #newsticker 元素。它和它的所有 li 元素的height和/或width属性设置为 0

The problem is with your #newsticker element. It, and all of its li elements, have height and/or width properties set to 0.

所以任何代码负责调整/显示 #newsticker 及其内容似乎是罪魁祸首。

So whatever code is responsible for sizing/displaying the #newsticker and its content seems to be the culpret.

这是一个猜测,但这个脚本 qxlaktuelt_liveload.js 正在加载:

This is a guess, but this script qxlaktuelt_liveload.js is being loaded after this:

<script type="text/javascript">
    $("#qxlaktueltHolder").load("/contents/dk/modul/qxlaktuelt/qxlaktuelt.htm", function() {
        $("#qxlaktueltHolder").trigger("qxlaktuelt_loaded", []);
    });
</script>

所以取决于 load()

So depending on how long the load() takes, the script may or may not be loaded.

尝试:

<script type='text/javascript' src='http://www.qxl.dk/contents/dk/js/jcarousellite_1.0.1.min.js'></script>
<script type='text/javascript' src='http://www.qxl.dk/contents/dk/js/qxlaktuelt_liveload.js'></script>
<script type="text/javascript">
    $("#qxlaktueltHolder").load("/contents/dk/modul/qxlaktuelt/qxlaktuelt.htm", function() {
        $("#qxlaktueltHolder").trigger("qxlaktuelt_loaded", []);
    });
</script>

这篇关于IE8(兼容模式)将不会加载我的Ajax内容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆