0
我曾尝试使用下面的代码中声明HTML中的对象:如何在Safari中更新HTML对象数据并输入Javascript?
<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中的clueBox对象。它在Firefox中完美运行,但在Safari中完全不起作用。我需要让它在Safari中工作。有谁知道我该怎么做?
你在哪里调用函数? – vascowhite