User Tools

Site Tools


eg-259:lecture5

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
eg-259:lecture5 [2013/02/11 12:48] eechriseg-259:lecture5 [2013/02/12 08:27] (current) – [Screen Output: jQuery magic] eechris
Line 173: Line 173:
     * Because of the problems of broken scripts, many Web surfers disable JavaScript support in their browser.     * Because of the problems of broken scripts, many Web surfers disable JavaScript support in their browser.
     * Scripts can run slowly and complex scripts take a long time to start up((Again modern browser developers have put a lot of effort into making script engines more efficient. Conversely, web applications rely more and more on scripts, so this speed advantage may not last long)).     * Scripts can run slowly and complex scripts take a long time to start up((Again modern browser developers have put a lot of effort into making script engines more efficient. Conversely, web applications rely more and more on scripts, so this speed advantage may not last long)).
-    * To overcome browser issues, modern developers make use of libraries that provide better abstractions of the DOM and allow separation of concerns between the application data and the display of that data in HTML((Two popular libraries and jQuery and BackboneJS.))+    * To overcome browser issues, modern developers make use of libraries that provide better abstractions of the DOM and allow separation of concerns between the application data and the display of that data in HTML((Two popular libraries are jQuery and BackboneJS.))
  
  
Line 462: Line 462:
 ===== More on Variables and Operators ===== ===== More on Variables and Operators =====
  
-Visit the OpenJS tutorial for an interactive presentation. +Visit [[http://eloquentjavascript.net/chapter2.html|Chapter 2]] of Eloquent JavaScript.
- +
-  * [[http://www.openjs.com/tutorials/basic_tutorial/variables.php|Variables]] +
-  * [[http://www.openjs.com/tutorials/basic_tutorial/operators.php|Operators]] +
- +
-For even more details see [[http://eloquentjavascript.net/chapter2.html|Chapter 2]] of Eloquent JavaScript.+
  
  
Line 569: Line 564:
 ---- ----
  
-In Firebug +In Firefox and Chrome developer tools there is a JavaScript console. You can write to it using:
 <code javascript> <code javascript>
       console.log("Answer: " + result);       console.log("Answer: " + result);
 </code> </code>
-does almost the same thing as ''document.write'', but without destroying any content.+It's better than ''document.write'' because as well as outputting string versions of its argumentsit will actually output objects that you can browse. 
 +===== Screen Output: jQuery magic ===== 
 +  * HTML placeholder 
 +<code html> 
 +<div id="result"> 
 +</div> 
 +</code> 
 +  * Output function 
 +<code javascript> 
 +$('#result').append('<p>The html you would have written with <code>document.write()</code></p>'); 
 +</code> 
 +  * Result 
 +<code html> 
 +<div id="result"> 
 +<p>The html you would have written with <code>document.write()</code></p> 
 +</div> 
 +</code>
 ===== Screen Output: alert ===== ===== Screen Output: alert =====
  
eg-259/lecture5.1360586881.txt.gz · Last modified: 2013/02/11 12:48 by eechris