Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.javascript > #33615

Re: Crazy Quotes!

Newsgroups comp.lang.javascript
Subject Re: Crazy Quotes!
From "Evertjan." <exxjxw.hannivoort@inter.nl.net>
References <bc8875a5-1a83-4bc4-8653-66d85ab67ec8@googlegroups.com> <XnsA7BB6E617AF0Deejj99@194.109.6.166> <d1444797-c377-4d0a-bdf3-8748ed80ebcb@googlegroups.com>
Date 2017-07-23 17:24 +0200
Message-ID <XnsA7BBB11AFF04Eeejj99@194.109.6.166> (permalink)

Show all headers | View raw


justaguy <lichunshen84@gmail.com> wrote on 23 Jul 2017 in
comp.lang.javascript: 

> On Sunday, July 23, 2017 at 4:51:12 AM UTC-4, Evertjan. wrote:
>> wrote on 23 Jul 2017 in
>> comp.lang.javascript: 
>> 
>> 'use strict'; // add this for better debugging
>> 
>> > var cond = 'yes',
>> 
>> var cond = 'Yes' 
>> 
>> // error[1]: case sensitive Yes
>> 
>> >     lineX = '',
>> >     oid = 7;
>> > 
>> > if (cond == 'Yes') {lineX = 
>> >      "<br><input type=button value=Update
>> >      onclick=doSomething("+oid+")>" 
>> 
>> "<br><input type=button value=Update "
>> + "onclick='doSomething("+oid+");'"
>> 
>> // error[2]: onclick needs [here single-]quoted content
>> 
>> >      + "&nbsp;&nbsp;&nbsp;&nbsp;" + 
>> >      "<a href=mycomment.cfm?Number="+oid+" target=_new>Comment</a>";
>> >     }
>> >           
>> > var doSomething = function(oid) {
>> >      console.log(oid);
>> >}          
>> 
>> document.write(lineX);
>> 
>> // error[3]: you need the string to be inserted
>>  
>> > 
>> > Of the above, the quotes for the line with "onclick=soSomething()..."
>> > drives me nuts. How to fix them? 
>> 
>> You could easily have found this out by using the internal debugger
>> of your browser [I used Google-Chrome]:
>> 
> 
> Thanks. But three things:
> (1) The oid value needs to a string, ie, "NSS-892-A-233".

You did specify a number value.
Is that reason to say "thanks, but" ???

>> >     oid = 7;

var oid = '"NSS-892-A-233"';

> (2) Probably the ending ">" was missed in your 
> [ + "onclick='doSomething("+oid+");'" ] line

You are unshure?

> (3) For Chrome internal debugger, were you referring to dev tool's
> console tab? 

Why did you skip my link? The link gives the answer.


-- 
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)

Back to comp.lang.javascript | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Crazy Quotes! justaguy <lichunshen84@gmail.com> - 2017-07-22 20:56 -0700
  Re: Crazy Quotes! "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2017-07-23 10:51 +0200
    Re: Crazy Quotes! justaguy <lichunshen84@gmail.com> - 2017-07-23 06:17 -0700
      Re: Crazy Quotes! "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2017-07-23 17:24 +0200
        Re: Crazy Quotes! justaguy <lichunshen84@gmail.com> - 2017-07-23 08:36 -0700
  Re: Crazy Quotes! Julio Di Egidio <julio@diegidio.name> - 2017-07-23 08:17 -0700
    Re: Crazy Quotes! justaguy <lichunshen84@gmail.com> - 2017-07-23 08:33 -0700
      Re: Crazy Quotes! Julio Di Egidio <julio@diegidio.name> - 2017-07-23 09:01 -0700
        Re: Crazy Quotes! justaguy <lichunshen84@gmail.com> - 2017-07-23 20:14 -0700

csiph-web