0

The Mozilla browser has a createlink command that Rich Text Editors can call but I don't see a way to specify target = _blank to make the link open in a new page. I tried including target=_blank in the URL, like this

http://www.google.com target=_blank

But that keeps the link from working. Does anyone know how to do this?

Thanks.

Steve
  • 4,534
  • 9
  • 52
  • 110
  • This question may have your answer: http://stackoverflow.com/q/5605401/230167 – Bryan Downing Aug 01 '13 at 06:10
  • @Bryan Lots of good stuff there about range selection that I saved for the future, but didn't see anything on setting target. Thanks – Steve Aug 01 '13 at 15:43

1 Answers1

0

Ok, I got it

You can add

target="_blank"

to the url you pass to createLink but you have to be very careful to get the quotes right. You have to pass a string parameter, url, to createLink that causes the command to receive something like

                      "http://www.google.com"  target="_blank"

Another problem I was having is that I was putting the link into an element that had contentEditable="TRUE". Links don't behave well in these elements.

Steve
  • 4,534
  • 9
  • 52
  • 110