I’m trying to use the following as a URL that executes javascript:
javascript:var field = document.getElementsByName("actions[hide]"); + for (i = 0; i < field.length; i++)field[i].click();
However, the spaces get URL encoded when I bookmark it, replaced with %20, which (for a reason unknown to me) causes the JS code not to work.
javascript:var%20field%20=%20unescape%20document.getElementsByName("actions[hide]");%20+%20for%20(i%20=%200;%20i%20<%20field.length;%20i++)field[i].click();
if you want to create a bookmarklet i would suggest you this site:
http://benalman.com/code/test/jquery-run-code-bookmarklet/
there is written that it is used for jquery code but you can also convert normal javascript with this generator. Or you can simplify use the jquery and convert your code from:
to
i use this script every time i create a new bookmarklet and i love it
EDIT: when you enter your code you must paste it without the “javascript:” text in front.