jQuery/iframe在Chrome中不起作用 [英] jQuery/iframe not working in Chrome

查看:120
本文介绍了jQuery/iframe在Chrome中不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在这里创建了一个Facebook粉丝页面:

I have created a facebook fan page here:

http://www.facebook.com/apps/application.php?id = 120196931351044& v = app_120196931351044

它结合了iframe来调用使用jquery的某些页面/图像库.除了Chrome浏览器,其他所有浏览器都可以正常运行.在iframe中,Chrome没有显示任何内容,只有空白的空白背景.

It incorporates iframes to call certain pages/image galleries which use jquery. Everything works fine in all browsers except for Chrome. Nothing shows up in Chrome from the iframes, just empty white background.

我尝试使用 load 事件而不是 ready 处理程序,但还是没有运气.
有没有人看到镀铬中的类似问题?

I tried using load event instead of ready handler but still no luck.
Has anyone witnessed the similar issue in chrome?

我们将非常感谢您的帮助.

Your help will be greatly appreciated.

标题中的大图片通过iframe(包含jquery的页面)进入.

The big images in the header come through iframe,a page incorporating jquery.

更新:

如下面的注释所示,即使在Safari中,它似乎也无法正常工作.

As shown in the comments below, it doesn't seem to work even in Safari as well.

更新2

在iframe外部运行时,相同的代码似乎可以在chrome中运行,这是链接进入工作页面:

The same code seems to work in chrome when run outside of the iframe, here is the link to working page:

http://jsbin.com/esame4/4

更新3:

使用iframe时,Chrome中似乎仍然存在此问题,如下所示:

It seems that this problem persists in chrome when using iframes as can be seen here:

http://www.google.am/support/forum/p/Chrome/thread?tid = 2c81c3e3fd99b388& hl = zh-CN
http://forums.sharethis.com/topic.php?id=2742

推荐答案

解决方案实际上很简单.为了在看到Facebook页面/应用程序时在Chrome中很好地显示iframe内容,您必须从受保护的服务器调用内容或属性.

The solution is actually simple. To get your iframe stuff display well in Chrome when you see a Facebook page/app, you have to call content or properties from an secured server.

您必须确保所有必需的文件和文件夹(如CSS,JS和图像文件)都位于安全文件夹内.

You MUST ensure that all your required files and folders like the CSS, JS and image files are inside a secured folder.

  1. 为此,您需要域的SSL证书.

  1. For this you need a SSL certificate for your domain.

更改htaccess文件和mod重写条件以对所有或特定文件夹强制使用SSL,尤其是在使用变量调用文件时.如果您使用的是绝对URL,请将其更改为https.

Alter your htaccess file and mod rewrite condition to force SSL for all or specific folders especially when you are using variables to call the files. If you're using absolute URL change them to https.

希望这会有所帮助!

这篇关于jQuery/iframe在Chrome中不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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