JavaScript testing beginner's guide : test and debug JavaScript the easy way /
Annotation
Clasificación: | Libro Electrónico |
---|---|
Autor principal: | |
Otros Autores: | |
Formato: | Electrónico eBook |
Idioma: | Inglés |
Publicado: |
Birmingham, UK :
Packt Pub.,
2010.
|
Temas: | |
Acceso en línea: | Texto completo |
Tabla de Contenidos:
- Cover; Copyright; Credits; About the Author; About the Reviewers; Table of Contents; Preface; Chapter 1: What is JavaScript Testing?; Where does JavaScript fit into the web page?; HTML Content; Time for action
- building a HTML document; Styling HTML elements using its attributes; Specifying id and class name for an HTML element; Cascading Style Sheet; Time for action
- styling your HTML document using CSS; Referring to an HTML element by its id or class name and styling it; Differences between a class selector and an id selector; Other uses for class selectors and id selectors
- Complete list of CSS attributesJavaScript providing behavior to a web page; Time for action
- giving behaviour to your HTML document; JavaScript Syntax; JavaScript events; Finding elements in a document; Putting all together; The difference between JavaScript and server-side languages; Why pages need to work without JavaScript; What is testing?; Why do you need to test?; Types of errors; Loading errors; Time for action
- loading errors in action; Partially correct JavaScript; Time for action
- loading errors in action; Runtime errors; Time for action
- runtime errors in action; Logic Errors
- Time for action
- logic errors in actionSome advice for writing error free-JavaScript; Always check for proper names of objects, variables, and functions; Check for proper syntax; Plan before you code; Check for correctness as you code; Preventing errors by choosing a suitable text editor; Summary; Chapter 2: Ad Hoc Testing and Debugging in JavaScript; Purpose of ad hoc testing-getting the script to run; What happens when the browser encounters an error in JavaScript; Browser differences and the need to test in multiple browsers; Time for action
- checking for features and sniffing browsers
- In browsersTesting browser differences via capability testing; Time for action
- capability testing for different browsers; Are you getting the output and putting values in the correct places?; Accessing the values on a form; Time for action
- accessing values from a form; Another technique for accessing form values; Accessing other parts of the web page; Time for action
- getting the correct values at the correct places; Does the script give the expected result?; What to do if the script doesn't run?; Visually inspecting the code; Using alert() to see what the code is running
- Using alert() to see what values are being usedTime for action
- using alert to inspect your code; A less obtrusive way to check what code is running and the values used; Time for action
- checking what values are used unobtrusively; Commenting out parts of the script to simplify testing; Time for action
- simplifying the checking process; Timing differences-making sure HTML is there before interacting with it; Why ad hoc testing is never enough; Summary; Chapter 3: Syntax Validation; The difference between validating and testing