[Javascript] Escape Javascript?

Paul Novitski paul at dandemutande.org
Tue Mar 30 11:06:32 CST 2004


Ant,

To address your bookmarking problem, maybe what you need to do is render 
the text URL-safe using the Javascript function escape() rather than taking 
the & route.  If necessary, you could use unescape() to translate the 
string back to normal before actually writing it to your child window.

Another nice pair of tools for debugging are the .outerHTML and .innerHTML 
properties, which give you the HTML script for an object including the 
object's own tag and attributes (.outerHTML) and enclosed by the tag only 
(.innerHTML).  These could help in cases in which you want your child 
window to display the actual HTML being generated for a particular part of 
your page.

Paul


At 07:29 AM 3/30/2004, you wrote:

>hello,
>         I am basically trying to make a bookmarklet, which does a
>createElement('Div'), and has within it a link which will create a new
>window and write some html into it.  If i linkify the bookmarklet,
>everything works fine, but add to favorites and it fails if there is any
>html markup (from debugging angle brackets seem to be the problem).  Since
>javascript is writing javascript which will write html you'll see a lot of
>&lt markup.
>Rather than cut and paste a thousand or so chars on a single line, or
>attach a file (not sure if this ius allowed).  The precise information is
>located here http://www.antsite.co.uk/jscript.html
>it looks pretty boring, but it's a light debugging version.  If anyone has
>any ideas i'd love to hear from you!!
>cheers
>ant
>
>
>
>
>
>--
>Pizza makes you thin
>
>Web     http://antsite.co.uk
>Fax     0870 8315126
>_______________________________________________
>Javascript mailing list
>Javascript at LaTech.edu
>https://lists.LaTech.edu/mailman/listinfo/javascript





More information about the Javascript mailing list