Ver Mensaje Individual
  #1 (permalink)  
Antiguo 03/06/2004, 12:19
Avatar de BooMeranGz
BooMeranGz
 
Fecha de Ingreso: febrero-2001
Mensajes: 350
Antigüedad: 23 años, 2 meses
Puntos: 0
Problema al incluir "files.js", ¿que solucion hay?

Hola,
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:
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;
};
Para mostrar el ejemplo, hago esta página de prueba, que contiene este código:
Código:
<? 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>
Luego de ejecutarla, veo el código fuente generado que es este:
Código:
<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>
Y siempre me aparece esa funcion function SymError() que no se de donde sale.

Los files java contienen esto:

--> error.js:
Código:
function 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");
}
--> javas.js
Código:
function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}
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?

Gracias de antemano y Salu2.