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 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.1360586923.txt.gz · Last modified: 2013/02/11 12:48 by eechris