google.load('visualization'...)bug? [英] google.load('visualization'...) bug?
问题描述
当我从已经呈现的页面中调用以下内容时,document.body似乎已从DOM中移除:
When I call the following from an already-rendered page, the document.body appears to be removed from the DOM:
google.load('visualization', '1', {packages:['table']});
可以在小提琴中查看问题:
The problem can be viewed in a fiddle:
请注意,我最初认为它可能与Mootools有关,但在提琴手中,我可以选择任何框架并查看相同的行为,这让我怀疑Google的jsapi中存在一个错误。
Note that I initially thought it might be related to Mootools, but in the fiddler, I can pick any framework and see the same behavior, leading me to suspect a bug in Google' s jsapi.
我是否缺少简单的东西?
Am I missing something simple?
推荐答案
感谢Vikram的建议。果然,任何回调都能防止身体'消失':
Thanks for the suggestion, Vikram. Sure enough, any callback will prevent the 'disappearance' of the body:
google.load('visualization', '1', {packages:['corechart'], callback:function() { alert('!'); }});
有关'bug'和'working'版本的演示,请参阅:
For a demo of the 'bug' and the 'working' version, see:
这篇关于google.load('visualization'...)bug?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!