Tengo un problema al incluir files "xxx.js" (JavaScript) desde un require()...
Los llamo con una funcion definida en un file data.php que tiene esto:
Código:
Para mostrar el ejemplo, hago esta página de prueba, que contiene este código:function tags_head($DIRh) { GLOBAL $cEstilo; define("cEstilo0","<link rel='SHORTCUT ICON' href='http://$DIRh/favicon.ico'>\n"); define("cEstilo1","<link href='http://$DIRh/webs.new/main/css/estilo1.css' rel='stylesheet' type='text/css'>\n"); define("cEstilo2","<link href='http://$DIRh/webs.new/main/css/estilo2.css' rel='stylesheet' type='text/css'>\n"); define("cEstilo3","<SCRIPT language='JavaScript' src='http//$DIRh/webs.new/main/js/error.js'></SCRIPT>\n"); define("cEstilo4","<SCRIPT language='JavaScript' src='http//$DIRh/webs.new/main/js/javas.js'></SCRIPT>\n"); $cEstilo = cEstilo0.cEstilo1.cEstilo2.cEstilo3.cEstilo4; return $cEstilo; };
Código:
Luego de ejecutarla, veo el código fuente generado que es este:<? require_once($_SERVER['DOCUMENT_ROOT']."/webs.new/inc/data.php"); ?> <html> <head> <title><? echo cIndexBrowserTitle; ?></title> <meta http-equiv="" content="text/html; charset=iso-8859-1"> <?=tags_head($DIRh); ?> </head> </body> </html>
Código:
Y siempre me aparece esa funcion function SymError() que no se de donde sale.<html> <head> <title>aaaaaaaaaaaaaaaaaaaa</title> <meta http-equiv="" content="text/html; charset=iso-8859-1"> <link rel='SHORTCUT ICON' href='http://localhost/favicon.ico'> <link href='http://localhost/webs.new/main/css/estilo1.css' rel='stylesheet' type='text/css'> <link href='http://localhost/webs.new/main/css/estilo2.css' rel='stylesheet' type='text/css'> <script language="JavaScript"> <!-- function SymError() { return true; } window.onerror = SymError; //--> </script> <SCRIPT language='JavaScript' src='http//localhost/webs.new/main/js/error.js'></SCRIPT> <SCRIPT language='JavaScript' src='http//localhost/webs.new/main/js/javas.js'></SCRIPT> </head> </body> </html>
Los files java contienen esto:
--> error.js:
Código:
--> javas.jsfunction formulario_error(id) { window.open("<? $DIR ?>/webs.new/main/form/form_error.php?order_id="+id,"","height=400,width=410,status=no,toolbar=no,directories=no,menubar=no,location=no,resizable=no,scrollbars=no, left=15,top=25"); }
Código:
Creo que lo que tengo mal es la funcion que llama a los js y los css, ¿pero que es lo que no esta funcionando para que me salaga siempre el java de error?function MM_jumpMenu(targ,selObj,restore){ //v3.0 eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'"); if (restore) selObj.selectedIndex=0; }
Gracias de antemano y Salu2.