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;;)]­);\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(``)]);\n');">A­dvertise</button>

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


Avatar for Gordon @Gordon started