is it necessary that js are placed in the header?, im running into a frustrating issue with my script placed in the body as i need to create a js var and give it a value using php
this is the souce code on my browser and it clearly shows a value for thid
PHP Code:
<script type="text/javascript">
$('#suggest').click(function(){
window.location.href='TimeSheet.php?batId=474&empId=33&admin=false&suggest=true';
});
$('#cancel').click(function(){
javascript: history.go(-1);
});
$('#logout').click(function(){
window.location.href='logout.php';
});
var thid=224; // here
</script>
and this is the js console exception
PHP Code:
<script type="text/javascript">
$('#suggest').click(function(){
window.location.href='TimeSheet.php?batId=474&empId=33&admin=false&suggest=true';
});
$('#cancel').click(function(){
javascript: history.go(-1);
});
$('#logout').click(function(){
window.location.href='logout.php';
});
var thid=; //here exception thrown
[error]Uncaught SyntaxError: Unexpected token ;[error]
</script>
this occurs sometimes only a havent been able to understand why !!