Meta Programming with JavaScript

1,209 views
997 views

Published on

A talk I gave at Ignite Boston 2007.

Published in: Technology
0 Comments
4 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
1,209
On SlideShare
0
From Embeds
0
Number of Embeds
5
Actions
Shares
0
Downloads
8
Comments
0
Likes
4
Embeds 0
No embeds

No notes for slide

Meta Programming with JavaScript

  1. 1. Meta-Programming with JavaScript John Resig Mozilla / jQuery
  2. 2. Browser Web Dev HTML DOM JavaScript
  3. 3. DOM + HTML<html><head><script>window.onload = function(){ var test = document.getElementById(“test”); test.style.color = ‘green’; test.style.display = ‘block’;};</script></head><body><div id=”test” style=”display:none;”> You have JavaScript enabled!</div></body></html>
  4. 4. A JS Library HTMLjQuery DOM JavaScript
  5. 5. jQuery<html><head><script src=”jquery.js”></script><script>$(function(){ $(“#test”).css(“color”,”green”).show();});</script></head><body><div id=”test” style=”display:none;”> You have JavaScript enabled!</div></body></html>
  6. 6. Meta Programming HTML Meta jQuery DOMLibrary JavaScript
  7. 7. jQuery “2”<html><head><script src=”jquery.js”></script><script src=”jquery2.js”></script><script type=”text/jquery”>#test: css “color” ”green” show</script></head><body><div id=”test” style=”display:none;”> You have JavaScript enabled!</div></body></html>
  8. 8. Demohttp://ejohn.org/apps/jquery2/
  9. 9. More Details• http://jquery.com/• http://ejohn.org/apps/jquery2/• http://ejohn.org/blog/advancing-javascript-with-libraries/• http://yuiblog.com/blog/2007/04/16/video-resig/

×