【发布时间】:2011-12-04 13:31:49
【问题描述】:
我已经使用以下代码在 HTML 中声明了一个对象:
<object type="text/plain" id="clueBox" data="clues/random.txt" height="315" width="560"></object>
然后在我的 Javascript 中,我有一个如下所示的函数:
function dummy(){
var box = document.getElementById("clueBox");
//alert(currentClue + " " + clueTypes[clueNum]);
box.setAttribute("type", "text/plain");
box.setAttribute("data", "clues/clue0.txt");
alert("Called Dummy");
}
调用此函数应该会更新 HTML 中的线索框对象。它在 Firefox 中完美运行,但在 Safari 中根本无法运行。我需要让它在 Safari 中工作。有谁知道我该怎么做?
【问题讨论】:
-
你如何/在哪里调用函数?
标签: javascript safari html