unexpected call to method or property access
If you try to add style declarations in the head of a document, IE borks at the name 'style' - "unexpected call to method or property access".
I guess its getting confus开发者_如何学JAVAed between the head element and the object property .style?
var t = document.createElement("style")
t.setAttribute("type", "text/css");
t.setAttribute("media", "screen");
var temp_text = document.createTextNode(v + " {visibility:hidden}");
t.appendChild(temp_text)
Where v is id of a flash object.
This might help: http://www.phpied.com/dynamic-script-and-style-elements-in-ie/
For IE U have do like this
var t = document.createElement("style")
t.setAttribute("type", "text/css");
t.setAttribute("media", "screen");
if(t.styleSheet)
t.styleSheet.cssText = v + " {visibility:hidden}" ;
else
{
var temp_text = document.createTextNode(v + " {visibility:hidden}");
t.appendChild(temp_text)
}
This would help you
精彩评论