Jquery问题在Firefox和IE中,但不是Chrome
Jquery issue in Firefox and I.e but not Chrome
嗨,我们已经在我们的网站中实现了无限滚动功能。在Chrome中一切正常,但是Firefox和IE没有加载下面的JavaScript代码吗?我们确实有https,所以这可能是问题所在,如果是这样,我们如何解决它。波纹管是我们当前的代码
$(document).ready(function () {
var ajax_arry = [];
var ajax_index = 0;
var sctp = 100;
$('#loading').show();
$.ajax({
url:"ajax.php",
type:"POST",
data:"function=showData&type=homeactivity&page=1",
cache: false,
success: function (response) {
$('#loading').hide();
$('#postStatus1').html(response);
}
});
$(window).scroll(function () {
var height = $('#postStatus1').height();
var scroll_top = $(this).scrollTop();
if(ajax_arry.length>0) {
$('#loading').hide();
for(var i=0; i<ajax_arry.length; i++) {
ajax_arry[i].abort();
}
}
var page = $('#postStatus1').find('.nextpage').val();
var isload = $('#postStatus1').find('.isload').val();
if($(window).scrollTop() == $(document).height() - $(window).height() && isload=='true') {
$('#loading').show();
var ajaxreq = $.ajax({
url: "ajax.php",
type: "POST",
data: "function=showData&type=homeactivity&page="+page,
cache: false,
success: function (response) {
$('#postStatus1').find('.nextpage').remove();
$('#postStatus1').find('.isload').remove();
$('#loading').hide();
$('#postStatus1').append(response);
}
});
ajax_arry[ajax_index++] = ajaxreq;
}
return false;
if($(window).scrollTop() == $(window).height()) {
alert("bottom!");
}
});
});
谢谢!
...试试这个...使用 $(window).load 而不是 $(document).ready...
相关文章:
- IE/Chrome中未定义的函数,但Firefox中没有
- 滚动在Chrome中有效,但在Firefox或IE中无效
- CKeditor预览插件.js,为Chrome和IE进行编辑.因为它拒绝CSS样式
- 如何编写在Chrome和IE中正常工作的JavaScript
- document.images未加载在chrome或firefox上,但已加载在IE上
- Javascript赢得'不能在IE上编译,但可以在Chrome上运行
- IE与Chrome的怪癖模式
- Json到CSV下载,可以在chrome中工作,但不能在IE浏览器中工作
- Jquery selectmenu组合框在IE和Chrome中每当按钮打开时就会关闭
- 以下颜色更改功能在IE9和Firefox中运行良好,但在早期的IE或Chrome中则不然
- window.opener not working in chrome & IE
- HTML5视频无法在chrome上工作,在服务器上托管后的IE,mov文件中的视频(quicktime格式)
- Iframe加载调整大小在Chrome中工作,但不能在IE或Firefox中工作
- AngularJS$http.post没有'不适用于Chrome,仅适用于IE
- Javascript'元素'在ie中未定义,但在chrome和firefox中运行良好
- Multi-platform (Chrome, IE, Firefox)
- Javascript在JS Fiddle中工作,但在Chrome / IE中不起作用
- jQuery:$.getJSON对Chrome/IE上的数据进行排序
- 输入元素在Firefox中没有定义,但在Chrome/IE中有
- 下拉JavaScript的onClick事件不触发Chrome/IE