...

View Full Version : How can I call a JS function of a dynamically created <iframe>?



levyavi
03-11-2005, 12:47 AM
Hello,

I have the following problem:

inside a JS function I have following code:

var e = document.getElementById("CommentsiFrameSpan" + Code)
e.innerHTML="<IFRAME src=\"" + url + "\" name=\"Comments" + Code + "\" id=\"Comments" + Code + "\"></IFRAME>";




Code and url are variables that are passed to the function.
after creating the frame, I want to set the parent of the dynamically created frame and call JS function inside the frame. How do I do that?


Thanks,
Avi

glenngv
03-11-2005, 05:36 AM
document.getElementById("Comments" + Code).contentWindow.theFunction();



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum