i have an error when calling twice a function inside iframe with simplemodal. With IE works ok With Firefox i have the error. Prueba.shtml the parent script: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/ TR/html4/strict.dtd"> <html> <head><title>ORCA: CRM Comercial</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <style> #modalOverlay {background-color:#000; cursor:wait;}
#modalContainer { height:400px; width:600px; left:50%; top:15%; margin-left:-300px; /* half the width, to center */ background-color:#fff; border:3px solid #ccc; } #modalContainer a.modalCloseImg { background:url(/gestioncomercial/Scripts/JQuery30/CRM_Modal/basic/ img/x.png) no-repeat; width:25px; height:29px; display:inline; z-index:3200; position:absolute; top:-14px; right:-18px; cursor:pointer; } </style> <script type="text/javascript" src="/gestioncomercial/Scripts/JQuery30/ jquery.js"></script> <script src='/gestioncomercial/Scripts/JQuery30/CRM_Modal/basic/js/ jquery.simplemodal-1.1.1.js' type='text/javascript'></script> </head><body> <a href="javascript:Presenta_Formulario_CRM('Prueba2.shtml')">pulsa</ a> <script type="text/javascript"> function Presenta_Formulario_CRM (param) { var CRM_Formulario = "<div><a href='javascript:window.frames[\"CRM_Dialog \"].CRM_Graba_Accion()'>Grabar</a></div>"; CRM_Formulario += '<div><iframe src="'+param+'" name="CRM_Dialog" width="100%" marginwidth="0" height="750px" marginheight="0" scrolling="no" frameborder="0" id="CRM_Dialog"></iframe></div>'; $(CRM_Formulario).modal({ persist: true, closeTitle: ('Cerrar'), containerCss: { height:'600px', width:'800px', left:'30%', top:'5%'}, }); } </script> </body></html> Prueba2.shtml The script inside the IFRAME: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/ TR/html4/strict.dtd"> <html><head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>ORCA: CRM Gesti�n Comercial</title> <script type="text/javascript"> function CRM_Graba_Accion() {alert ("entra");} </script> </head> <body> </body></html> Launch Prueba.shtml then click "pulsa" opens the modal then inside the modal click "Grabar" Works ok (display alert). close the modal and repeat when click "Grabar" again te function is not recognized WHY?? any help? Regards Enrique