Path: csiph.com!2.us.feeder.erje.net!feeder.erje.net!1.eu.feeder.erje.net!weretis.net!feeder4.news.weretis.net!feeder5.news.weretis.net!news.solani.org!.POSTED!not-for-mail From: Thomas 'PointedEars' Lahn Newsgroups: comp.lang.javascript Subject: Re: How to deal with "messy" quotes? Date: Mon, 12 Dec 2016 20:43:57 +0100 Organization: PointedEars Software (PES) Lines: 24 Message-ID: <1748120.PIDvDuAF1L@PointedEars.de> References: <1t06petyfg1wr.t3tve8utmbrg.dlg@40tude.net> Reply-To: Thomas 'PointedEars' Lahn Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8Bit X-Trace: solani.org 1481571838 9429 eJwNx8kBwCAIBMCW5NhFy0EC/Zdg5jcwCiucoGMwV1d3lc4B8pv4Hxoy0GYfu5S0bC4G3ffWByiSENQ= (12 Dec 2016 19:43:58 GMT) X-Complaints-To: abuse@news.solani.org NNTP-Posting-Date: Mon, 12 Dec 2016 19:43:58 +0000 (UTC) User-Agent: KNode/4.14.2 Cancel-Lock: sha1:yaY9Du0/KO2nZ65SGj0VwUIMflQ= X-Face: %i>XG-yXR'\"2P/C_aO%~;2o~?g0pPKmbOw^=NT`tprDEf++D.m7"}HW6.#=U:?2GGctkL,f89@H46O$ASoW&?s}.k+&. For me, I always use double quotes (") for HTML and JavaScript codes since > CSS requires double quote to be the quote character. Then you are proceeding from a false assumption: > The only exception is when assigning HTML code into > `innerHTML`/`outerHTML` properties where I'll use single quotes ('). If > the HTML code happens to require single quotes too, I'll escape them. > e.g.: > > ele.innerHTML = 'There\'s an input error'; The resulting markup would not be valid: you have started a “span” element and ended a “b” element. -- PointedEars FAQ: | | Twitter: @PointedEars2 | Please do not cc me./Bitte keine Kopien per E-Mail.