UPDATE
Seeing that you were in a PHP state already, the syntax was correct.
The problem is that the div
doesn't possess an onload event. You'll have to attach it to the body tag, or include a script in the head or below the div, as it will only execute after the div has been rendered.
You're not including the PHP variable correctly. At the moment you are passing the string .$threadid.
to the checkReply
function. You will have to drop into PHP mode again before using this syntax by using the delimiters <?php & ?>
.
<div id="chatwrap" onload="checkReply(<?php echo $threadid; ?>)"></div>
This should work better.