Well, before I jump out the window, I'm trying to write to a tbody of a table which is in a iframe (text box).
The table is loaded in the iframe SRC from a HTML file in the Hype Project.
My test script, an hype javascript named ProduitAjout , do the job perfectly from a button.
I need to trigger the previous script from a external script but as soon the as ProduitAjout is call I get this error:
Error in undefined: ReferenceError: Can't find variable: ProduitAjout
I refer to ProduitAjout with:
function myCallback(hypeDocument, element, event)
{
var myDocName = hypeDocument.documentName() ;
var iframePanier = document.getElementById('PanierDeCommande').children[0] ;
var iframeDocument = iframePanier.contentDocument || iframePanier.contentWindow.document ;
var tBody = iframeDocument.querySelector( '#Panier_Liste' )
HYPE.documents[myDocName].functions().ProduitAjout(null, null, null, iframePanier, iframeDocument, tBody) ;
return true;
}
if("HYPE_eventListeners" in window === false)
{
window.HYPE_eventListeners = Array();
}
window.HYPE_eventListeners.push({"type":"HypeDocumentLoad", "callback":myCallback});
I'm sure I'm missing something, but can't find where.
Thank you for your help.