Foros del Web » Programando para Internet » Javascript »

vincular javascript externo

Estas en el tema de vincular javascript externo en el foro de Javascript en Foros del Web. Hola, quiero vincular un javascript externo: hice lo siguiente pero no me vincula. @import url("http://static.forosdelweb.com/clientscript/vbulletin_css/geshi.css"); Código HTML: Ver original <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 ...
  #1 (permalink)  
Antiguo 29/11/2011, 11:44
 
Fecha de Ingreso: mayo-2010
Mensajes: 414
Antigüedad: 14 años, 4 meses
Puntos: 2
vincular javascript externo

Hola, quiero vincular un javascript externo: hice lo siguiente pero no me vincula.

Código HTML:
Ver original
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <script type="text/javascript" src="js/validar-formulario.js" ></script>
  4. </head>
  5. </body>


El javascript: ESTA DENTRO DE LA CARPETA js con nombre validar-formulario.js

Código Javascript:
Ver original
  1. function MM_findObj(n, d) { //v4.01
  2.   var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
  3.     d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  4.   if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  5.   for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  6.   if(!x && d.getElementById) x=d.getElementById(n); return x;
  7. }
  8.  
  9. function MM_validateForm() { //v4.0
  10.   var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments;
  11.   for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=MM_findObj(args[i]);
  12.     if (val) { nm=val.name; if ((val=val.value)!="") {
  13.       if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
  14.         if (p<1 || p==(val.length-1)) errors+='- '+nm+' debe contener una dirección de email.\n';
  15.       } else if (test!='R') { num = parseFloat(val);
  16.         if (isNaN(val)) errors+='- '+nm+' debe contener un número.\n';
  17.         if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
  18.           min=test.substring(8,p); max=test.substring(p+1);
  19.           if (num<min || max<num) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';
  20.     } } } else if (test.charAt(0) == 'R') errors += '- '+nm+' se requiere.\n'; }
  21.   } if (errors) alert('los siguientes errores ocurrieron:\n'+errors);
  22.   document.MM_returnValue = (errors == '');
  23. }
  #2 (permalink)  
Antiguo 29/11/2011, 11:55
 
Fecha de Ingreso: julio-2006
Mensajes: 21
Antigüedad: 18 años, 2 meses
Puntos: 0
Respuesta: vincular javascript externo

SI le das a ver el código fuente de la página y pinchas el vínculo del js, llegas? Quizas sea problema de rutas.

Etiquetas: externo, formulario, html, js, vincular
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 13:07.