Scott Andrew - lo-fi acoustic pop superhero!

Join the Demo Club to unlock new music, get discounts, tour dates and other neato stuff:

or learn more here.

November 28, 2001

Foreign scripts with bookmarklets

This cool bookmarklet from Josh Santangelo exposes all of the <!-- comments --> in the web page you happen to be looking at, and introduces an intriguing thing: the bookmarklet imports a JavaScript file from another domain and attaches it to the page, via the DOM interface. Look at this code snippet (from the bookmarklet):


scScript=document.createElement(’script’);
scScript.src=’http://dbz.nu/x/showcomments.js’;
scScript.type=’text/javascript’;
scScript.defer=true;
void(document.getElementsByTagName(’head’)[0].appendChild(scScript));

The script then runs in the context of the page being viewed, even though it’s a foreign script from another domain. Hmmm. (linkage via Matt)

No Comments on “Foreign scripts with bookmarklets”

Leave a Comment

Close
  • E-mail
  • Social Web

Email this page to a friend:

E-mail It

Buy Music

Download Scott Andrew tracks from iTunes Find Scott Andrew at Rhapsody Find Scott Andrew at Amazon Find Scott 
Andrew at CD Baby

New Videos

More Videos

Photos

More Photos at Flickr

Recent Reader Comments

  • Patrick: I wondered why you were wearing that silly mask in...
  • scottandrew: Actually, I was thinking of wearing it myself.
  • Erik: Okay, but if you could get him to wear the bat sui...
  • chris: One good song. Very, very poppy however. Material ...
  • spinhead: Your songs have a very "Look, I'm telling you . . ...