document.getElementById无法在FBJS上运行

时间:2010-04-10 13:56:30

标签: fbml fbjs

我正在使用FBML和FBJS在Facebook上开发应用程序。当我尝试使用document.getElementById来读取标记时,它没有回复正确的值。 我们真的可以在FBML上使用这个命令来获取数据吗?

以下是我的代码的详细信息:

<input type="hidden" value="123" id="number"/>
<a href="#" onclick="new Dialog().showMessage('Dialog', document.getElementById('number').value);return false"/>

1 个答案:

答案 0 :(得分:1)

我找到了答案。我们可以通过以下方式访问该值:

<input type="hidden" value="123" id="number"/> <a href="#" onclick="new Dialog().showMessage('Dialog', document.getElementById('number').getValue());return false"/>