Editing Internet bookmarklets

Warning: You are not logged in. Your IP address will be recorded in this page's edit history.
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision Your text
Line 1: Line 1:
-
Although not widely known, in most browsers you can run JavaScript code by typing it in the address bar. This script can then do anything a regular script loaded from a website can. If you bookmark such a script then it is called a '''bookmarklet'''.
+
Although not widely known, in most browsers you can run javascripts by typing them in the url-bar. This script can then do anything a regular script loaded from a website can. If you bookmark such a script then it is called a bookmarklet.  
[http://www.rit.albany.edu/~ew2193/bookmarklets.html Here are some examples]. Just bookmark the links on that page and you're ready to use them.
[http://www.rit.albany.edu/~ew2193/bookmarklets.html Here are some examples]. Just bookmark the links on that page and you're ready to use them.
Line 5: Line 5:
These scripts should start with 'javascript:', can only contain one line and function calls should be enclosed with the 'void()' statement, unless they're called from within another function. This bookmarklet for example changes the font and background color of a page:
These scripts should start with 'javascript:', can only contain one line and function calls should be enclosed with the 'void()' statement, unless they're called from within another function. This bookmarklet for example changes the font and background color of a page:
-
<pre><nowiki>
+
javascript:void(main());function main(){c('body');c('td');c('div');c('p');}
-
javascript:void(main());function main(){c('body');c('td');c('div');c('p');}function c(elname){el=document.getElementsByTagName(elname);for(i=0;i<el.length;i++){el[i].style.background='black';el[i].style.color='white';}}
+
function c(elname){el=document.getElementsByTagName(elname);
-
</nowiki></pre>
+
for(i=0;i<el.length;i++){el[i].style.background='black';el[i].style.color='white';}}
 +
Note: The code has been divided into three lines to fit on the wiki page.
[[Category:Users]]
[[Category:Users]]
[[Category:Web]]
[[Category:Web]]
[[Category:Power users]]
[[Category:Power users]]

Learn more about Contributing to the wiki.


Please note that all contributions to maemo.org wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see maemo.org wiki:Copyrights for details). Do not submit copyrighted work without permission!


Cancel | Editing help (opens in new window)