0

I have a commenting tool that can be included on a page simply by adding a script tag to the <head>. This works fine, and I've made a Greasemonky script and Firefox plugin that do just that, and putting it manually on a site works fine too. However I'm trying to make a bookmarklet:

javascript:(function(){var%20ormeo=document.createElement('script');
ormeo.src='http://www.ormeo.net/js/ormeoStart.js';
ormeo.type='text/javascript';
document.getElementsByTagName('body')[0].appendChild(ormeo);})();

...and this doensn't work (on Firefox 3.5). Any ideas why? Other bookmarklets that do the same thing, add a <script> tag to the <head> work fine, why not mine?

Sinan Taifour
  • 10,521
  • 3
  • 33
  • 30
  • I just tried this bookmarklet on my computer and it worked fine. It does exactly what it's supposed to. Can you describe specifically what it isn't doing? – Dan Herbert Aug 01 '09 at 22:35

2 Answers2

1
javascript:(function(){var ormeo=document.createElement('script');
ormeo.src='http://www.ormeo.net/js/ormeoStart.js';
ormeo.type='text/javascript';
document.getElementsByTagName('head').item(0).appendChild(ormeo);})();

Please try this code. It will help you.

Banty Roy
  • 914
  • 6
  • 23
0

Try adding the script tag to the head instead of the body:

document.getElementsByTagName('head')[0].appendChild(ormeo);})();
Luca Matteis
  • 29,161
  • 19
  • 114
  • 169