JavaScript DOM Nodes and Exception Handling Tutorial for beginners - PowerPoint PPT Presentation

About This Presentation
Title:

JavaScript DOM Nodes and Exception Handling Tutorial for beginners

Description:

Learn JavaScript DOM Nodes and Exception Handling through catch experts online tutorial classes,it covers document object model nodes and javascript debugging, exception handling concepts briefly. – PowerPoint PPT presentation

Number of Views:67

less

Transcript and Presenter's Notes

Title: JavaScript DOM Nodes and Exception Handling Tutorial for beginners


1
CATCH EXPERTS
https//www.catchexperts.com
http//www.courseing.com
2
JavaScript DOM Nodes and Exception Handling
Tutorial Videos for Beginner by
3
Highlights
  • Document Object Model Nodes
  • 1. DOM Nodes
  • 2. DOM Levels
  • 3. DOM Interfaces
  • Debugging and Exception Handling
  • 1. Try-catch-Finally statement
  • 2. Error event and Browser Sniffing
  • 3. JSLint Checker

4
DOM Nodes
  • HTML elements are called as nodes
  • Create the node in order to insert a new element
    into the DOM.
  • Syntax var paragraph document.createElement(
    q")
  • To add text to the ltqgt element, you must create a
    text node first.
  • Syntax var node document.createTextNode("This
    is a new para")
  • Appending the text node to the ltqgt element is as
    follows
  • Syntax paragraph.appendChild(node)

5
DOM Levels
  • It has three levels. DOM Level 1, DOM Level 2,
    DOM Level 3.
  • DOM Level 1 divided into two parts i.e. Core part
    and HTML, defines the core elements of the DOM.
  • DOM level 2 consist six dissimilar
    specifications, they are DOM2 Core, Views,
    Events, Style, Traversal and Range, and the DOM2
    HTML.
  • DOM2 extends Dom1 elements and adds events.
  • DOM3 has five dissimilar specifications, they are
    DOM3 Core, Load and Save, Validation, Events, and
    XPath.
  • DOM 3 extends DOM2 and adds new elements and
    events.

6
DOM Interfaces
  • Interfaces are use to manage HTML, XML and SVG
    documents.
  • Provides a structured representation of the
    document.
  • Specifies approach to access and manipulate apps
    inner representation of a document.
  • DOM application documents representation depends
    on Interfaces. 
  • Obsolete DOM interfaces, HTML interfaces, HTML
    element interfaces, Obsolete HTML interfaces, SVG
    interfaces, SVG element interfaces, SVG data type
    interfaces, SMIL related interfaces are different
    types of DOM interfaces.

7
Debugging and Exception handling
  • Web Console, Browser console are the chrome
    browser web developer options useful for
    debugging.
  • Firefox provides Error console and Browser
    debugger for debugging
  • Error console is outdated and is no longer
    enabled in Firefox by default. Use the Web
    Console or the Browser Console instead.
  • JavaScript will show three types of errors in
    programming Syntax Errors, Runtime Errors, and
    Logical Errors.

8
Debugging and Exception handling
  • Syntax errors are also called as parsing errors
    which occur at compile time
  • If syntax error occurs the code thread only would
    be affected remaining threads gets executed
  •  Runtime errors are also called as exceptions
    which occur during execution.
  • Exceptions also affect the thread in which they
    occur, other JavaScript threads continues their
    execution.
  • Logic errors can be the most difficult type of
    errors to track down. 
  • Logic errors are the outcome of a syntax or
    runtime error. 

9
Try , Catch, Finally Statement
  • Every try block will have exactly one catch block
    or one finally block.
  • When an exception occurs in the try block, it
    throws the error 
  • Syntax try  //code that may throw exception
      
  • catch(Exception class Name ref) or finally
  • catch block handles the errors thrown by try
    block
  • In the final the optional finally block executes
    unconditionally after try/catch.

10
Error Event and Browser Sniffing
  • Error event interface represents events providing
    information correlated to exceptions in scripts
    or in files.
  • ErrorEvent() constructor creates
    an ErrorEvent event with the user specified
    parameters.
  • Browser sniffing is the technique used to
    determine the  visitor web browser, to  serve
    browser appropriate content to the visitor.
  • Browser sniffing also called as browser detect.

11
JSLint Checker
  • JSLint Checker is JavaScript code quality checker
    tool.
  • Helps to notice exceptions and possible troubles
    in code.
  • Supports very quick and easy way to check code.
  • Analyzes JavaScript source code to advise about
    quality troubles. 
  • Provides Limited number of configuration options.
  • Difficult to identify which ruling is causing
    errors.

12
Feedback
Like It ? Hate It?
We would love to hear from you whatever you think
about the course.
Click HERE to share what you think!
13
Thank you
Thank You for Watching JavaScript DOM Nodes and
Exception Handling Tutorial Videos for
Beginner by
http//www.courseing.com
Write a Comment
User Comments (0)
About PowerShow.com