Javascript question

Out of context: Reply #5

  • Started
  • Last post
  • 12 Responses
  • vaxorcist0

    the question is oddly worded ... at least to a developer....

    you may want to read:
    http://stackoverflow.com/questio…

    maybe node.js, but that's beyond the idea here I think...

    sure, you can dynamically write JS client-side running code by using a server-side language, like PHP, note that QBN may tweek the code below....

    <?php
    if($somevar=="yes"){
    echo "<form name=myform>
    <input type=button value=\"click here now\"
    onClick="alert('Hello from JavaScript!')\">
    </form>";
    ?>

    Note the \" problem.... you have to escape quotes, this can drive you crazy

    • argh, you will have to \" the " before "alert for this to runvaxorcist
    • Oh yeah, I suppose it could be just a really convoluted way of asking about dynamic JS. +1 vaxdetritus

View thread