This is a simple syntax question.
I declare a variable:
<script type="text/javascript">
var id_1= '<?php echo $id; ?>';
</script>
And then in a externally loaded js file im trying to call a function using the variable (the external js file is loaded after the ^^ variable declaration:
loadComments(id_1);
The id_1 is being passed literally as 'id_1', not recognizing it should be a variable. What am I doing wrong?
$idhold in php.. add analert(id_1);right after assigning the variable... what does it alert ?loadCommentscode ? and do you get an error or just wrong results ?