简体   繁体   English

ajax内容未在ie7和8上加载

[英]ajax content not loading on ie7 and 8

it is working on all browsers but ie7 and ie8. 它适用于所有浏览器,但ie7和ie8。 The content dosn't seem to load into the site when we press a menu item while it does work on all major browsers, not sure if it is due to the supersised plugin (?) 当我们按下菜单项时,内容似乎不会加载到网站中,而它在所有主流浏览器上都有效,不确定是否是由于超级插件(?)

I can't get my head around it and I'm kinda stack! 我无法理解它,我有点堆叠!

ps If it can help anyhow: I am loading the content once supersized animation has finished, you can find this at the end of supersized.shutter.min.js ps如果它无论如何都可以提供帮助:我在超大型动画完成后加载内容,你可以在supersized.shutter.min.js的末尾找到它

Any takers please? 请接受任何参赛者? Thanks! 谢谢!

The error in my firebug is with this line: 我的萤火虫中的错误是这一行:

jQuery(".content").lionbars();

maybe enclose it in: 也许把它包括在:

jQuery(document).ready(function(){
  jQuery(".content").lionbars();
}):
$(".content").each(function(){
     this.lionbars();
 });

This would do the trick. 这样就可以了。 refer jquery.min.js above the block where this script is called. 在调用此脚本的块上方引用jquery.min.js。

Just had a similar problem myself. 我自己也遇到过类似的问题。 Is the html that gets returned by the ajax call valid html? 是否由ajax调用返回的html有效html? If it is not then IE8 and IE7 will not display it (would be nice if they gave an error message but they dont). 如果不是那么IE8和IE7将不会显示它(如果他们给出错误消息会很好但是他们不会)。

One way to confirm whether this is the issue is if you can simplify the ajax content to be something like: 确认这是否是问题的一种方法是,如果您可以将ajax内容简化为:

<p> hello world</p>

If this then starts showing up in IE7/8 then you need to fix the html that your ajax load returns. 如果这开始出现在IE7 / 8中,那么你需要修复你的ajax加载返回的html。

The problem being with IE parsing the document was causing this issue. IE解析文档的问题是导致此问题。 Since I am using wordpress i manage to get around the issue by calling the header and the footer with ajax. 由于我使用wordpress,我设法通过使用ajax调用页眉和页脚来解决问题。

<?php if (!is_ajax_request()) get_header(); ?>
  -----
 <?php if (!is_ajax_request()) get_footer(); ?>

in my function.php i have: 在我的function.php中我有:

 function is_ajax_request() {
  return (!empty($_SERVER['HTTP_X_REQUESTED_WITH']) &&            strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest');
 }

Done :) 完成:)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM