javascript 在 ie8 中不工作
我使用了 fb 脚本来增加画布的大小。这是代码..
<div id="fb-root"></div>
<script type="text/javascript">
window.fbAsyncInit = function () {
FB.init({ appId: '171963559525911', status: true, cookie: true, xfbml: true });
FB.Canvas.setSize({ width: 1500, height: 1500 });
};
(function () {
var e = document.createElement('script');
e.type = 'text/javascript';
e.src = document.location.protocol +
'//connect.facebook.net/en_US/all.js';
e.async = true;
document.getElementById('fb-root').appendChild(e);
} ());
</script>
<script src="http://ajax.microsoft.com/ajax/jquery/jquery-1.4.2.min.js" type="text/javascript"></script>
它适用于我测试过的所有浏览器(IE8 除外)。事实上在 IE9 中也能工作,但在 IE8 中却不能工作。
请建议我解决这个问题。
谢谢
I have used a fb script to increase a size of canvas. Here is the code..
<div id="fb-root"></div>
<script type="text/javascript">
window.fbAsyncInit = function () {
FB.init({ appId: '171963559525911', status: true, cookie: true, xfbml: true });
FB.Canvas.setSize({ width: 1500, height: 1500 });
};
(function () {
var e = document.createElement('script');
e.type = 'text/javascript';
e.src = document.location.protocol +
'//connect.facebook.net/en_US/all.js';
e.async = true;
document.getElementById('fb-root').appendChild(e);
} ());
</script>
<script src="http://ajax.microsoft.com/ajax/jquery/jquery-1.4.2.min.js" type="text/javascript"></script>
It is working in all browsers I've tested except IE8. In fact also working in IE9 but not working in IE8.
Please suggest me to solve the issue.
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
这就是我用来扩展画布大小的方法,它适用于所有浏览器:
您还需要将 xd_receiver.htm 放在可公开访问的目录中。这是该文件的内容:
xd_receiver.htm
编辑:
显然将高度设置为内容的高度。之前我有:
但IE似乎不喜欢那样。不应该显式设置高度#,但在这种情况下必须这样做。
This is what I use for extending the size of my canvas and it works in all browsers:
You need to have the xd_receiver.htm inside of a publicly accessibly directory as well. Here is the contents of that file:
xd_receiver.htm
EDIT:
Obviously set the height to whatever the height of your content is. Before I had:
But IE seems to not like that. Shouldn't have to explicitly set the height #, but had to in this case.
让我们试试这个:
Lets try this one:
应该是
should be