Java Script
- You can use JavaScript to select any element, attribute, or text from an HTML page.
- You can use JavaScript to add elements, attributes, and text to the page, or remove them
- You can specify a set of steps forthe browser to follow (like a recipe),which allows it to access or change the content of a page
- react to event
- jQuery will help you deal with cross-browser
inconsistencies
A script is a series of instructions that a
computer can follow to achieve a goal.
- To write a script, you need to first state your goal and then list the tasks that need to be completed in order to achieve it.
steps of writting script
- DEFINE THE GOAL
- DESIGN THE SCRIPT
- CODE EACH STEP
- Every step for every task shown in a flowchart needs to be written in a language the computer can understand and follow
debuging
discover what might have gone wrong
- Every step for every task shown in a flowchart needs to be written in a language the computer can understand and follow
Often scripts will need to perform different tasks in different situations. You can use flowcharts to work out how the tasks fit together. The flowcharts show the paths between each step.
- each physica l thing in the world can be represented as an object
- Each object can have its own:
- Properties
- Events
- Methods
Methods
it represent things people need to do with objects. They can retrieve or update the values of an object’s properties.
-
Computers use data to create models of things in the real world.The events, methods, and properties of an object all relate to each other:Events can trigger methods, and methods can retrieve or update an object’s properties.
- WEB BROWSERS ARE PROGRAMS BUILT USING OBJECTS
- THE DOCUMENT OBJECT REPRESENTS AN HTML PAGE
- All major browsers use a JavaScript interpreter to translate your instructions (in JavaScript) into instructions the computer can follow.
Web developers usually talk about three languages that are used to create web pages: HTML, CSS, and JavaScript.
- CONTENT LAYER => html files
- PRESENTATION LAYER => css file
-
BEHAVIOR LAYER => js file
- The JavaScript is added last and enhances the usability of the page or the experience of interacting with the site.
- JavaScript is written in plain text, just like HTML and CSS, so you do not need any new tools to write a script.
- When you want to use JavaScript with a web page, you use the HTML
- document object repreent the entire webpage