我正在学习Google Wave小工具。

我正试图强制我的小工具自行调整大小。

但我不断收到 gadgets.window 未定义的错误。

这是我的小工具:

<?xml version="1.0" encoding="UTF-8" ?> 
<Module>
<ModulePrefs title="GitHub Gist Gadget">
  <Require feature="wave" /> 
  <!--Require feature="locked-domain" /-->
  <Require feature="dynamic-heights" />
</ModulePrefs>
<Content type="html">
<![CDATA[ 
<div id="content_div"> 

<input type=button onclick="gadgets.window.adjustHeight()" />

<script src="http://gist.github.com/244697.js"></script>

<script type="text/javascript">
  gadgets.window.adjustHeight()
</script>

</div>
  ]]> 
  </Content>
</Module>

顺便说一句,如果你知道将GitHub gists嵌入Google Waves的小工具,请告诉我。 : - )

有帮助吗?

解决方案

动态高度替换为动态高度

gadgets.window.adjustHeight()应替换为 gadgets.util.registerOnLoadHandler(gadgets.window.adjustHeight),因为gadgets.window可能未加载你初始化小工具。

其他提示

针对同样的问题,但使用igoogle小工具设计。

我发现gadgets.window对象仅在沙盒中可用,但您可以使用igoogle功能:

_IG_AdjustIFrameHeight();

会自动调整iframe,igoogle。 ;)

来源: http://code.google.com / p / OpenSocial的资源/问题/细节?ID = 572个

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top