Jump to content

Syntax issue


EchoFool

Recommended Posts

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?

Link to comment
https://forums.phpfreaks.com/topic/171314-syntax-issue/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.