Path: csiph.com!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: Wed, 14 Dec 2016 12:24:18 +0100 Organization: PointedEars Software (PES) Lines: 96 Message-ID: <20318636.6Emhk5qWAg@PointedEars.de> References: <5d7849ff-803f-44bf-a64a-f51f7df741ab@googlegroups.com> <71de1dbd-1779-4131-8c68-4c9d6e01d774@googlegroups.com> <1903833.irdbgypaU6@PointedEars.de> <6635730.EvYhyI6sBW@PointedEars.de> Reply-To: Thomas 'PointedEars' Lahn Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8Bit X-Trace: solani.org 1481714669 1712 eJwNwoERwCAIBLCVwIenjCMo+49gL3FQ2WF0ms+PxgogIV24GGjGZi+fdTYNWR1HcwRL7ycPCPYQcA== (14 Dec 2016 11:24:29 GMT) X-Complaints-To: abuse@news.solani.org NNTP-Posting-Date: Wed, 14 Dec 2016 11:24:29 +0000 (UTC) User-Agent: KNode/4.14.2 Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAGFBMVEXTxa4RFk5dUWANED8PFEfy7+MGBiW+n3ZNF/QuAAACaElEQVQ4jVXUwVOcMBQG8Dc7Rc4PUntdWV2uxjDpGaGeozOp1woar4jd5t/v9wLstMwsA/ntlxdCAgUc1hjTc9/JCZfGoo3wG3HdmdAWrIJRHe7GM/TmpY5VFefuVcAkkPbLIaN8rmPmjloyZxgyR3GuJ4K0AGtJ2htz8o7yqikm759fldQXaMpbDzjKAG+8v+AugVTOPO5DOjLvGtUYQwh0CPjnVMyGd+8/GfUB5nLKJDD2aLDh5HYyMDJGDwQIo2ZmZcKbowNmAdB/AzyFhrmF2MHRb0QJJfaAnwGB6orZhoykLzJtGwF/xpYxI1dswomiUj3gTuAIqCn/4C7cULwGNBtwMTk3Y4LfKB5YUaOKBKYtpplm7u0vip8tU1NWWyI/7XdcSuIDoMt6rVHMWT0DbjHPGqDqZVSa6zleLcUTcIKLoMv3ueJluALtAo9B302zPPlrtiVScRdCjXvVh3e3JpYa/jjkuC9N+LrBMlz/eAN4eQijX2EdLo6c5tGGHwLyHFtXk89dDGHwCVhG9T0S/j55AhRZgkMCmUQXJ49TnS1wnQDvw0eAh9ICeMmEFbCnPMFzjAvsWoEWEFdYEx+S0MoUZ1gT1wId8+AF3Bl2OoEu906AUHx5VLw/gXYg/x84loOah/2UYNrgiwSwGO7RfUzVBbx/kgpckumGOi6QirtD6gkLTitbnxNol47S2jVc2vsN5kPqaAHT8uUdAJM4v/DanjYOwmUjWznGfwB7sGtAtor5BgofDuzaRj4kSQAqDakTsKORa3Q3xKi3gE1fhl71KRMqrdZ2AWNNg/YOhQyrVBnb+i+nEg4bsDA+egAAAABJRU5ErkJggg== Cancel-Lock: sha1:4NfkJR5BZB5ngBjKwUFwmty8qco= X-Face: %i>XG-yXR'\"2P/C_aO%~;2o~?g0pPKmbOw^=NT`tprDEf++D.m7"}HW6.#=U:?2GGctkL,f89@H46O$ASoW&?s}.k+&. Thomas 'PointedEars' Lahn wrote: >> cyber@example.com wrote: >>> Thomas 'PointedEars' Lahn wrote: >>>> cyber@example.com wrote: >>>>> 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(). >>> It does work. >> For suitable values of “work”. > > It produces the intended result without error in all major browsers. It does not. | Intention: | for the s.innerHTML to have a button, with a "+" value/sign, upon click | of which, it loads a function named "newFN" with two parameters ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >>> In javascript >> There is no “javascript”. > > Guess this room should be renamed to comp.lang.notjavascript then. Fool, this is not an (Web/Internet [relay] chat) room, it is a Usenet newsgroup. As for “javascript”, see my sig. >>> parameters default to undefined >> In implementations of ECMAScript, the value of formal parameters for >> which no argument was passed usually defaults to the “undefined” value. > > The author his code is likely meant for browsers. > This means that talking about implementations of ECMAScript in general > might not be as relevant to him as talking about Javascript as implemented > in the major browsers is. My point was your wrong, wannabe terminology. > He edited my code to pass 1 argument instead of 2 which made me think that > he changed his mind and now only wanted to pass 1 argument instead of 2. > And since we do not know what he wants to do with this (newFN seems to > be a mere placeholder for testing purposes) it really is not that obvious > what he wants. The record shows, and this thread shows it again, that the OP does not know what the heck they are doing. Neither do you. It is very obviously cargo cult programming at best. As I have showed, string concatenation to build markup from variable values is _not_ how this is done properly with regard to maintainability, runtime efficiency, and security, to name just the most important aspects. And, for sure, the values that are displayed to the user certainly should not coincide with the values used internally, so, missing HTML escaping aside, using “fn” in those two places is *wrong*. Your concluding that the OP’s unexplained omission constitutes a change of mind is far-fetched, to say the least. Does it require a formal complaint to your service provider before you stop abusing the example.com documentation domain? Does it require lots of people to killfile you before you get yourself a (real) name? Or can you, perhaps, just FOAD, before you spread further wannabe nonsense? Because we really do not need yet another one of you. TIA. -- PointedEars FAQ: | | Twitter: @PointedEars2 | Please do not cc me./Bitte keine Kopien per E-Mail.