Ayudar a encontrar ERROR en JavaScript

  • CGFX
  • Graduate
  • Graduate
  • Avatar de Usuario
  • Registrado: Oct 26, 2003
  • Mensajes: 160
  • Loc: Chicago, IL.
  • Status: Offline

Nota Noviembre 6th, 2010, 1:26 pm

Todos,

Estoy tratando de aprender a mano el código JavaScript, estoy aprendiendo de un libro de Shelly Cashman texto de la serie de 1999 titulada "JavaScript Introducción Conceptos y Técnicas. Es la enseñanza que creo la versión 1. ¿Puede un experto ver rápidamente el código de abajo y dime lo que está mal? mi cadena document.write no se representará.

Gracias de antemano.

Código: [ Select ]
<html>

<head>
<title>Test Your Knowledge Introduction</title>
</head>

<body>

<p align="center"><img src="CarbonCopy.jpg" width="294" height="121"></p>

<p align="center"><img src="wavygraybar.jpg" width="756" height="16"></p>

<p align="center">Welcome to Carbon Copy Printers.

<SCRIPT LANGUAGE="JAVASCRIPT">
<!-- Hide the script from old browsers --
today = new Date()
If ((today.getHours() >=4) && (today.getHours() <=12)){
 document.write("Good Morning. Have a rush job for the afternoon? We can handle it!")
}
If ((today.getHours() >12) && (today.getHours() <=18)){
 document.write("Good Afternoon. We can have that print job ready by tomorrow morning.")
}
If ((today.getHours() >18) && (today.getHours() <=23)){
 document.write("Good Evening> We will be here all night if you need us!")
}
If ((today.getHours() >=0) && (today.getHours() <4)){
 document.write("Yes, we are working at this hour!")
}
// -- End Hiding Here -- >
</SCRIPT>

We are open 24 hours a day. No job is too big or too small.</p>

<blockquote>
 <ul>
  <li>Resumes</li>
  <li>Brochures</li>
  <li>Invitations</li>
  <li>Newsletters</li>
  <li>Posters</li>
  <li>Ads</li>
 </ul>
</blockquote>
</body>
</html>
  1. <html>
  2. <head>
  3. <title>Test Your Knowledge Introduction</title>
  4. </head>
  5. <body>
  6. <p align="center"><img src="CarbonCopy.jpg" width="294" height="121"></p>
  7. <p align="center"><img src="wavygraybar.jpg" width="756" height="16"></p>
  8. <p align="center">Welcome to Carbon Copy Printers.
  9. <SCRIPT LANGUAGE="JAVASCRIPT">
  10. <!-- Hide the script from old browsers --
  11. today = new Date()
  12. If ((today.getHours() >=4) && (today.getHours() <=12)){
  13.  document.write("Good Morning. Have a rush job for the afternoon? We can handle it!")
  14. }
  15. If ((today.getHours() >12) && (today.getHours() <=18)){
  16.  document.write("Good Afternoon. We can have that print job ready by tomorrow morning.")
  17. }
  18. If ((today.getHours() >18) && (today.getHours() <=23)){
  19.  document.write("Good Evening> We will be here all night if you need us!")
  20. }
  21. If ((today.getHours() >=0) && (today.getHours() <4)){
  22.  document.write("Yes, we are working at this hour!")
  23. }
  24. // -- End Hiding Here -- >
  25. </SCRIPT>
  26. We are open 24 hours a day. No job is too big or too small.</p>
  27. <blockquote>
  28.  <ul>
  29.   <li>Resumes</li>
  30.   <li>Brochures</li>
  31.   <li>Invitations</li>
  32.   <li>Newsletters</li>
  33.   <li>Posters</li>
  34.   <li>Ads</li>
  35.  </ul>
  36. </blockquote>
  37. </body>
  38. </html>
  • Anonymous
  • Bot
  • No Avatar
  • Registrado: 25 Feb 2008
  • Mensajes: ?
  • Loc: Ozzuland
  • Status: Online

Nota Noviembre 6th, 2010, 1:26 pm

  • CGFX
  • Graduate
  • Graduate
  • Avatar de Usuario
  • Registrado: Oct 26, 2003
  • Mensajes: 160
  • Loc: Chicago, IL.
  • Status: Offline

Nota Noviembre 6th, 2010, 2:25 pm

Error de actualización: recibo el siguiente error meassge de la herramienta Internet Explorer devopler que dice: "Objeto espera - línea 18 caracteres 2 - Rompiendo el JS error de ejecución previsto de objetos".

Yo todavía no entiendo?


Gracias,

CgFX
  • BooGiE_MaN
  • Proficient
  • Proficient
  • Avatar de Usuario
  • Registrado: Jun 05, 2005
  • Mensajes: 387
  • Loc: Cape Town, South Africa
  • Status: Offline

Nota Noviembre 18th, 2010, 9:21 am

Trate de reemplazar "Si" por "si" - entre mayúsculas y minúsculas.

Por cierto el uso de Firefox y el complemento de "Firebug" es mucho más útil en la búsqueda de errores - IE le dará los errores más vaga que puedas imaginar.

Simply Links Directory
  • CGFX
  • Graduate
  • Graduate
  • Avatar de Usuario
  • Registrado: Oct 26, 2003
  • Mensajes: 160
  • Loc: Chicago, IL.
  • Status: Offline

Nota Noviembre 19th, 2010, 9:33 am

BooGiE_MaN,

Muchas gracias, voy a darle una oportunidad.

CgFX

Publicar Información

  • Total de mensajes en este tema: 4 mensajes
  • Usuarios navegando por este Foro: No hay usuarios registrados visitando el Foro y 148 invitados
  • No puede abrir nuevos temas en este Foro
  • No puede responder a temas en este Foro
  • No puede editar sus mensajes en este Foro
  • No puede borrar sus mensajes en este Foro
  • No puede enviar adjuntos en este Foro
 
 

© 2011 Unmelted, LLC. Ozzu® es una marca registrada de Unmelted, LLC