Lect22CodeOrgJSCons - available without JavaScript You...

Info iconThis preview shows pages 1–7. Sign up to view the full content.

View Full Document Right Arrow Icon
Announcements Check class announcements daily You must implement programming projects by yourself 1
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
2 Separating Content from Behavior Keep each of the following separate Content (HTML) Presentation (CSS) Behavior (JavaScript) Separating HTML and JavaScript Use src attribute of <script> Place the <script></script> in <head> Example: folder named Separation
Background image of page 2
3 Advantages of Separation Simplifies HTML files (removes large segments of JavaScript code) Functions can be cached by the browser for efficiency Code sharing/reuse Function used by several pages can be kept in a single file
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
4 Use of JavaScript in Web Pages Unobtrusive JavaScript programming paradigm specifying that JavaScript should not intrude on users accessing a web page, on HTML content, or CSS Stylesheets Goals Keep JavaScript code separate from HTML Scripts are enhancements to HTML content, but the content should be
Background image of page 4
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Background image of page 6
Background image of page 7
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: available without JavaScript You should design web pages so they operate even if JavaScript is disabled The <noscript> tag can be used to define content where scripting cannot be used (e.g., disabled by user) Example: folder named Separation Run example with JavaScript Disabled Tools Options Content (in Firefox) 5 Break Statement break cause the innermost loop to exit immediately It is only legal if it appears inside a loop or switch statement Example: Break.html, NoBreak.html break can also be used with a label 6 Switch Statement Type of conditional statement Example: SwitchNames.html, Switch.html charAt Allows us to retrieve the character associated with a particular position in a string Example: charAt.html 7...
View Full Document

This note was uploaded on 11/04/2010 for the course CMSC cmsc122 taught by Professor Perez during the Fall '10 term at University of Maryland Baltimore.

Page1 / 7

Lect22CodeOrgJSCons - available without JavaScript You...

This preview shows document pages 1 - 7. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online