Learning 'dynamic' javascript bookmarklet
Posted
by
Seatbelt99
on Stack Overflow
See other posts from Stack Overflow
or by Seatbelt99
Published on 2010-12-31T05:46:34Z
Indexed on
2010/12/31
5:53 UTC
Read the original article
Hit count: 225
JavaScript
|bookmarklet
Little help for a javascript noob please... I have this in a .js file on my web server:
Q=document.selection?document.selection.createRange().text:document.getSelection(); alert(Q);
I highlight some text on a web page (tested with Chrome and firefox) and paste this into the address bar:
javascript:(function(){vara=document.createElement('SCRIPT');a.type='text/javascript';a.src='http://automatethegame.com/js/test.js?';document.getElementsByTagName("head")[0].appendChild(vara)})();
it appears to do nothing. Any assistance or suggestions would be appreciated. thanks
© Stack Overflow or respective owner