Path: csiph.com!aioe.org!news.mixmin.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: Tue, 13 Dec 2016 13:17:59 +0100 Organization: PointedEars Software (PES) Lines: 42 Message-ID: <1903833.irdbgypaU6@PointedEars.de> References: <5d7849ff-803f-44bf-a64a-f51f7df741ab@googlegroups.com> <71de1dbd-1779-4131-8c68-4c9d6e01d774@googlegroups.com> Reply-To: Thomas 'PointedEars' Lahn Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8Bit X-Trace: solani.org 1481631480 12352 eJwFwYEBwCAIA7CXhJVSz1EY/59gEh+NlWAQMTENnbxXlc0dV+vI1bAp9pT7+gk7GuOGxvEAJg0REg== (13 Dec 2016 12:18:00 GMT) X-Complaints-To: abuse@news.solani.org NNTP-Posting-Date: Tue, 13 Dec 2016 12:18:00 +0000 (UTC) User-Agent: KNode/4.14.2 X-User-ID: eJwNy8kBwCAMA7CVyGED4xCX7D8C1V8IGjWTYKLR0Tu+5SyMoNZxQLi57GZnyc/BnBZOqlrF0A79xzRst/EBResVMw== X-Face: %i>XG-yXR'\"2P/C_aO%~;2o~?g0pPKmbOw^=NT`tprDEf++D.m7"}HW6.#=U:?2GGctkL,f89@H46O$ASoW&?s}.k+&. justaguy wrote: >> On Monday, December 12, 2016 at 5:10:17 PM UTC-5, justaguy wrote: >>> On Monday, December 12, 2016 at 1:15:22 PM UTC-5, cy...@example.com >>> wrote: >>> > justaguy <> wrote: >>> > > On Monday, December 12, 2016 at 12:53:40 PM UTC-5, cy...@example.com >>> > > wrote: >>> > >> var newFN = function(f,n) { ^^^ >>> > >> console.log(f,n); >>> > >> } > […] > This should work: > > s2.innerHTML = " " > + fn + > " 'newFN(\""+fn+"\" + "+num+");'>"; ^^^^^^^^^^^^^^ It does not. (The value of) “num” has to be (the value of) the *second* argument to newFN(). > If NewEl is meant to be the string "NewEl" then you need to put it between > quotes or else it will be be interpreted as a variable. > And num and the + operator should be outside the quotes since num is meant > to be a variable and + is meant to be the concatenation operator, but if > you put them between quotes they will just be seen as being the strings > "num" and "+" respectively. > > BTW the s2 button would call newFN while leaving n undefined so that > parameter could be removed. What a load of nonsense. Blind leading the blind. -- PointedEars FAQ: | | Twitter: @PointedEars2 | Please do not cc me./Bitte keine Kopien per E-Mail.