2

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 confused 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.

Rauf
  • 12,326
  • 20
  • 77
  • 126

2 Answers2

2

This might help: http://www.phpied.com/dynamic-script-and-style-elements-in-ie/

Sam Dutton
  • 14,775
  • 6
  • 54
  • 64
1

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

AmGates
  • 2,127
  • 16
  • 29