[thelist] Javascript bookmarklet to populate fields takes me to new page — why?

Barney Carroll barney.carroll at gmail.com
Wed Sep 23 04:46:26 CDT 2009


Thanks Ben,

> You could look into creating a bookmarklet that inserts the JS into the
page.
>
>
javascript:(function(){document.body.appendChild(document.createElement('script')).src='**
> your external file URL here **';})();
>
> That way you can keep maintenance of the files too :D

Not too bad an idea — I might stick to this because as you say, the script
can then evolve over time without managing bookmarks.

So it seems that what stops scripts entered via the URL bar from misbehaving
is an appended '()'. Why is that?

Regards,
Barney Carroll

barney.carroll at gmail.com
07594 506 381


2009/9/23 ben morrison <morrison.ben at gmail.com>

> On Wed, Sep 23, 2009 at 10:19 AM, ben morrison <morrison.ben at gmail.com>
> wrote:
>
> > You could look into creating a bookmarklet that inserts the JS into the
> page.
> >
> >
> javascript:(function(){document.body.appendChild(document.createElement('script')).src='**
> > your external file URL here **';})();
> >
> > That way you can keep maintenance of the files too :D
>
> A quick search -
> http://juhukinners.com/2009/01/08/how-to-write-a-bookmarklet/
>
> ben
> --
> Ben Morrison
> --
>
> * * Please support the community that supports you.  * *
> http://evolt.org/help_support_evolt/
>
> For unsubscribe and other options, including the Tip Harvester
> and archives of thelist go to: http://lists.evolt.org
> Workers of the Web, evolt !
>



More information about the thelist mailing list