如何使用iframe将googlegroups论坛嵌入到网页中?
我担心我面临着与前几次海报相同的挑战: 及 第一个问题解决了,但第二个问题没有解决 希望将google group论坛嵌入到html页面中。我无法按照谷歌集团使用如何使用iframe将googlegroups论坛嵌入到网页中?,iframe,embedding,google-groups,Iframe,Embedding,Google Groups,我担心我面临着与前几次海报相同的挑战: 及 第一个问题解决了,但第二个问题没有解决 希望将google group论坛嵌入到html页面中。我无法按照谷歌集团使用iframe提供的指导来做这件事: <iframe id="forum_embed" src="javascript:void(0)" scrolling="no" frameborder="0" width="900" height="700"&
iframe
提供的指导来做这件事:
<iframe id="forum_embed"
src="javascript:void(0)"
scrolling="no"
frameborder="0"
width="900"
height="700">
</iframe>
<script type="text/javascript">
document.getElementById('forum_embed').src =
'https://groups.google.com/forum/embed/?place=forum/test-distance'
+ '&showsearch=true&showpopout=true&showtabs=false'
+ '&parenturl=' + encodeURIComponent(window.location.href);
</script>
document.getElementById('forum_embed').src=
'https://groups.google.com/forum/embed/?place=forum/test-距离'
+“&showsearch=true&showpopoout=true&showtab=false”
+“&parenturl=”+encodeURIComponent(window.location.href);
并成功地展示了。我可以查看这个嵌入式论坛,但是当在我的html中应用相同的语法时,我没有成功
在Firefox 27或Internet Explorer 11中查看时,我同样缺乏成功的机会。您的示例对我来说很好 完成下面的示例代码
<!DOCTYPE html>
<head>
<title>Test</title>
</head>
<body>
<div>
<iframe id="forum_embed"
src="javascript:void(0)"
scrolling="no"
frameborder="0"
width="900"
height="700">
</iframe>
<script type="text/javascript">
document.getElementById('forum_embed').src =
'https://groups.google.com/forum/embed/?place=forum/test-distance'
+ '&showsearch=true&showpopout=true&showtabs=false'
+ '&parenturl=' + encodeURIComponent(window.location.href);
</script>
</div>
</body>
</html>
测验
document.getElementById('forum_embed').src=
'https://groups.google.com/forum/embed/?place=forum/test-距离'
+“&showsearch=true&showpopoout=true&showtab=false”
+“&parenturl=”+encodeURIComponent(window.location.href);
屏幕截图:
这对你和对我都有效。
“是”组的名称在该iframe上出现两次。
不要忘记将您的组名更改为您的组名。尝试在我的计算机上使用此代码,但未成功。页面加载没有错误,但显示没有内容的空页面。使用相同的代码,这对您有用吗?可能是浏览器问题?您使用的是哪种浏览器?我刚刚添加了一个使用Windows7和Chrome的JSFIDE的屏幕截图
<iframe id="forum_embed" src="https://groups.google.com/forum/embed/?place=forum/NAMEOFYOURGROUP#!forum/NAMEOFYOURGROUP" scrolling="no" frameborder="0" width="100%" height="700"></iframe>