Forum Moderators: open

Message Too Old, No Replies

call a function in an <OBJECT>?

         

merijnvw

10:47 pm on Jan 25, 2010 (gmt 0)

10+ Year Member



I have an <OBJECT> with an embedded file, how can I acces that through JavaScript so I can call a JS function in that object?
thanks

robbin

2:14 pm on Jan 26, 2010 (gmt 0)

10+ Year Member



get the properties of this object
for (i in <OBJECT>) {
alert(i)
}

call function in this object
<OBJECT>[i]()

merijnvw

3:57 pm on Jan 26, 2010 (gmt 0)

10+ Year Member



I didn't understand what you mean, but I got it working anyway, it was the simple way but first thought it wouldn't work.
For people who try to find this out:
JS: window.klaas.functionname();
HTML: <object name="klaas" src="drol.html"....></object>
drol.html-JS:function functionname(){...}