You are reading a single comment by @Gordon and its replies. Click here to read the full conversation.
  • The issue is that you have a quote inside a quote... Try:

    <button onClick="Puck.write('NRF.setAdvertising(­[beacon.get(&quot;goo.gl/test123&quot;)]­);\n');">Advertise</button>
    

    Basically it's the web browser itself thinks the string onClick="... has ended when it sees the second quote.

    There are other ways of doing it that are nicer, for instance you could use a third type of quotes! The templated String ones:

    <button onClick="Puck.write('NRF.setAdvertising(­[beacon.get(`goo.gl/test123`)]);\n');">A­dvertise</button>
    </body>
    

    Or you could add a function inside a <script> tag and call that, because inside that function you won't have the quoting issues.

About

Avatar for Gordon @Gordon started