flex-users / flex-iframe

IFrame component for Flex applications.
github.com/flex-users/flex-iframe
120 stars 63 forks source link

callIFrameFunction() couldn't work anyway. #9

Open nicoulaj opened 13 years ago

nicoulaj commented 13 years ago

Originally filed by OoOfree...@gmail.com on 2011-03-22T09:37:52

I have tried all the ways I could find, the function callIFrameFunction() just can't work.For example, http://code.google.com/p/flex-iframe/source/browse/#svn/trunk/examples/CallIFrameFunction .This example also can't work. No mater the brower is IE or Firefox. Could anyone give some advance? Thank you very much!

VrushaliDesai commented 13 years ago

Even I have problem getting the callFrameFunction to work with the latest library flex-iframe-1.5. Is there any workaround? Do we need the JavaScript functions to be in any particular format(e.g document.showAlert = function () ) ? Do we have any update on this issue?

dsworldtrip commented 13 years ago

Hey, This issue also affects iframeInstance.historyBack and iframeInstance.historyForward correct? I can´t seem to get them working with 1.5 IE 9 and Chrome. Do they work with 1.4.6?

dsworldtrip commented 13 years ago

just checked. javascript functions in 1.4.6 don't work. all ok 1.4.5

petr3petr commented 11 years ago

I used the source code for CALLIFRAMEFUNCTION from version 1.4.5 and all works ok

public static var INSERT_FUNCTION_CALLIFRAMEFUNCTION:String = "document.insertScript = function ()" + "{ " + "if (document." + FUNCTION_CALLIFRAMEFUNCTION + "==null)" + "{" + FUNCTION_CALLIFRAMEFUNCTION + " = function (iframeID, functionName, args)" + "{" + "var iframeRef=document.getElementById(iframeID);" + "var iframeDoc;" + "if (iframeRef.contentDocument) {" + "iframeDoc = iframeRef.contentDocument;" + "} else if (iframeRef.contentWindow) {" + "iframeDoc = iframeRef.contentWindow.document;" + "} else if (iframeRef.document) {" + "iframeDoc = iframeRef.document;" + "}" + "if (iframeDoc.wrappedJSObject != undefined) {" + "iframeDoc = iframeDoc.wrappedJSObject;" + "}" + "return iframeDocfunctionName;" + "}" + "}" + "}";