10 - Javascript

10 - Javascript - 1 CSE 135 Client-Side Programming...

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

View Full Document Right Arrow Icon

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

View Full DocumentRight Arrow Icon

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

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: 1 CSE 135 Client-Side Programming JavaScript Web Programming Paradigms • So far we have seen server-side programming Next • Enrich user experience, interactivity with client- side computations (JavaScript) – For example, validate that the user typed a number • Combine the best of both worlds with Ajax technologies 2 2 Architecturally speaking: What we’ve seen so far Browser Current Page New page Pure server-side architecture Form submission leads to request Server responds with new, typically HTML page 3 Server Architecturally speaking: What’s next. Javascript Browser Current Page Javascript User events may lead to activation of Form submission leads to request code User events may lead to activation of Javascript code, evaluated by the browser. They lead either to alerts, prompts, etc or to modification of part ( ) of the page 4 Server leads to request, then response by server 3 JavaScript • Programming language embedded in HTML – Directly or indirectly • Evaluated by the browser, interpreted • Triggered on page load and on certain programmer-defined events • While OO, it allows weak typing 5 While OO, it allows weak typing – Great opportunities for making a coding mess Architecturally speaking, what’s next (preview): Ajax Browser Current Page Javascript User events may lead to activation of Form submission leads to request code User events may lead to activation of Javascript code, evaluated by the browser Javascript code makes asynchronous request for additional data to server, uses server response to update part ( ) of the page 6 Server leads to request, then response by server 4 JavaScript Example 1 <html> <body> <script type="text/javascript”> <script type="text/javascript > document.write("Hello World!"); </script> </body> </html> 7 JavaScript Example 2 <html> <head> <script type="text/javascript"> <script type="text/javascript"> function displayMessage() { alert("Hello!"); } </script> </head> <body> <form>...
View Full Document

This note was uploaded on 08/31/2011 for the course CSE 135 taught by Professor Papakonstantinou during the Fall '10 term at UCSD.

Page1 / 14

10 - Javascript - 1 CSE 135 Client-Side Programming...

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

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