I have an iframe and inside that iframe a javascript function. I would like to be able to call that function from iframe’s parent because I need to set some values inside the iframe when it opens. So far I tried:
ClientScript.RegisterClientScriptBlock(this.GetType(), "saveTasks", "<script type='text/javascript'> function SaveTasks() { frames['myIframe'].location.href = 'myURL'; frames['myIframe'].test(); } </script>");
However, I am not able to call the test() function found in myURL file.
What is the specific syntax to do this, to call a javascript function inside child from its parent? Thank you
I’m not massively familiar with this. It doesn’t appear though that this segment of javascript has any way of being able to know what “frames[‘myIframe’]” is. There’s a lot of things that could be potentially going wrong such as is the $document even loaded?