javascript - HTML Code - Something is invalid - Cant Figure Out What -
i trying use on-completion function countdown plugin; however, whatever reason, dreamweaver telling me there syntax error tell change inner html of div contentcontainer. have been looking hours , cant find whats wrong it. hoping me out. appreciated.
<script language="javascript" type="text/javascript"> jquery(document).ready(function() { $('#countdown_dashboard').countdown({ targetoffset: { 'day': 0, 'month': 0, 'year': 0, 'hour': 0, 'min': 5, 'sec': 0 }, oncomplete: function() { document.getelementbyid('contentcontainer').innerhtml = '<div id="content"> <div class="success_box">application successful! redirecting...</div> <div class="error_box"></div> <div class="formcontainer"> <form id="formexample" name="example_form" action="#" method="post"> <label for="firstname">*first name:</label> <label for="lastname">*last name:</label> <input name="firstname" id="firstname" /> <input name="lastname" id="lastname" /> <label for="username">*username:</label> <label for="email">*email (a confirmation email sent here) :</label> <input onkeypress="makeithappen()" onkeyup="makeithappen()" name="username" id="username" /> <input onkeypress="makeithappenemail()" onkeyup="makeithappenemail()" name="email" id="email" /> <label for="password">*password:</label> <label for="password_confirm">*confirm password:</label> <input onkeypress="makeithappenemail()" onkeyup="makeithappenemail()" name="password" id="password" type="password" /> <input onkeypress="makeithappen()" onkeyup="makeithappen()" name="password_confirm" id="password_confirm" type="password" /> <button class="button gray" type="submit" name="submit">submit </button> <input id="usernameused" name="usernameused" type="hidden" value=""> <input id="emailused" name="emailused" type="hidden" value=""> </form> </div> </div>'; } }); }); </script> <div id="contentcontainer"> </div>
your problem have string left open. javascript not support multi-line strings either single (') or double (") quotes.
in other words
var d = "hello world "
is not valid, however, can use special character \ "consume" or "escape" newline , make act if single line string.
var d = "hello \ world "
hope helps!
Comments
Post a Comment