Welcome to DU! The truly grassroots left-of-center political community where regular people, not algorithms, drive the discussions and set the standards. Join the community: Create a free account Support DU (and get rid of ads!): Become a Star Member Latest Breaking News Editorials & Other Articles General Discussion The DU Lounge All Forums Issue Forums Culture Forums Alliance Forums Region Forums Support Forums Help & Search

hootinholler

(26,449 posts)
1. Off the top of my head...
Mon Jan 13, 2014, 03:56 PM
Jan 2014

You can't tell javascript to behave differently. There is no DWIM statement

I would try something like getSelection().replace(/"/g,""&quot ; Which should replace all " with the entity "

Admittedly, I would have to fuss with it to get it right, quote chars are tricky.

On Edit, quotes are tricky and du accepts the XML entity quot and translates it into a quote, so in the above line, the " inside the "" should be the entity & quot ; without the spaces.

Recommendations

0 members have recommended this reply (displayed in chronological order):

Javascript pros, code help needed..... [View all] Jesus Malverde Jan 2014 OP
Off the top of my head... hootinholler Jan 2014 #1
Thanks for your help on this one. Jesus Malverde Jan 2014 #2
The first thing to remember about javascript is hootinholler Jan 2014 #3
Message auto-removed Name removed Oct 2020 #6
Message auto-removed Name removed Jun 2020 #4
Message auto-removed Name removed Sep 2020 #5
Message auto-removed Name removed Jul 2021 #7
Thank you radhashetty Jun 2023 #8
Latest Discussions»Retired Forums»Website, DB, & Software Developers»Javascript pros, code hel...»Reply #1