简体   繁体   English

fancybox2 ajax请求中止

[英]fancybox2 ajax request aborted

I am using fancybox to open a php page with a form. 我正在使用fancybox打开带有表单的php页面。 My code is: 我的代码是:

$('#new').fancybox({
    type: 'ajax',
    autoSize : true,
    padding: 5,
    autoResize:true
});

The code works fine and the content page opens but when I check firebug I see that the destination page is called several times and each time firebugs tells me the request is aborted before rendering the page. 代码工作正常,并且内容页面打开,但是当我检查firebug时,我看到目标页面被调用了几次,并且每次firebug告诉我请求都在呈现页面之前被中止。 I have tried to google a bit but with no luck. 我试图谷歌一点,但没有运气。

I am using jquery 1.9.1 and fancybox 2.1.5. 我正在使用jquery 1.9.1和fancybox 2.1.5。 Any idea on why? 知道为什么吗?

Thanks a lot 非常感谢

Lelio 莱里奥

Ok, solved with a bit of luck... Posting here for anyone who could need it. 好的,运气好解决了...在这里张贴给任何需要的人。

The fancybox call was not in the document.ready function. fancybox调用不在document.ready函数中。

Moving it to the dom ready function solved the issue. 将其移至dom就绪功能即可解决此问题。

L 大号

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

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