skip to main | skip to sidebar

Cheap, fast, or good? Choose two.

Web sites and corporate diplomacy, presentations and meetings, and the joys of living near -- but not too near -- the bleeding edge. And of course the never-ending conversation about the tradeoffs between scope, schedule, and resources.

Thursday, January 08, 2009

Javascript Cheat Sheet

Cause I don't write js often enough to remember its syntax

Add js file to a page

var s=document.createElement('script');
s.setAttribute('src','http://foo.com/bar.js');
document.getElementsByTagName('head')[0].appendChild(s);

Add jQuery to a page

http://www.learningjquery.com/2008/06/updated-jquery-bookmarklet

Append js to a node in DOM w/ jQuery

$("#tab4").append("<script> alert("hello!") </script> ");

Posted by Elijah at 7:34 AM No comments:
Labels: javascript
Newer Posts Older Posts Home
Subscribe to: Posts (Atom)

Blog Archive

  • ▼  2009 (4)
    • ►  November (1)
    • ►  June (1)
    • ►  March (1)
    • ▼  January (1)
      • Javascript Cheat Sheet
  • ►  2008 (6)
    • ►  September (2)
    • ►  August (1)
    • ►  April (2)
    • ►  March (1)
  • ►  2007 (12)
    • ►  November (3)
    • ►  October (3)
    • ►  September (2)
    • ►  April (2)
    • ►  February (1)
    • ►  January (1)
  • ►  2006 (14)
    • ►  November (6)
    • ►  October (7)
    • ►  September (1)

Links

  • Nathan
  • Jan

Labels

  • accessibility
  • ajax
  • apache
  • bidirectional
  • browser support
  • browsers
  • closure
  • doh
  • html
  • IE7
  • iis
  • IT2.0
  • javascript
  • line break
  • localization
  • mac
  • mozilla
  • network
  • perl
  • port
  • regular expression
  • resources
  • strategy
  • system administration
  • user experience
  • vista
  • web 2.0
  • whale
  • windows
  • YUI