EchoFool Posted August 21, 2009 Share Posted August 21, 2009 Hey, I have a div which is linked with my JS script but im getting a syntax error for my function but not sure why... here is the function in JS function dochatbox(){ var chatbox = document.getElementById('chatdiv'); // var chatbox = 'chatdiv'; chatbox.scrollTop = chatbox.scrollHeight; } My div: <div id="chatbox" > <div id="chatdiv" style="border : solid 0px padding : 1px; width : 100%; height : 70px; overflow : auto;"> <? echo stripslashes($chat); ?> </div> </div> But i get this error: syntax error http://localhost/js/javascript.php Line 5 [break on this error] var chatbox = document.getElementById('chatdiv'); \n Any one know what i got wrong? Quote Link to comment Share on other sites More sharing options...
haku Posted August 22, 2009 Share Posted August 22, 2009 Try using double quotes. Quote Link to comment Share on other sites More sharing options...
corbin Posted August 22, 2009 Share Posted August 22, 2009 Single or double quotes shouldn't matter... If changing it to double quotes, can we see more code? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.