Here we'll need the help of PHP. Here is the code:
index.php
_______________ _______________ _______________ ___________
Code:
<?PHP
@session_start(); //Start our session.
if(@!session_is_registered('PrintTheJavaScript')){ //If the session is not registered (and it's not).
@session_register('PrintTheJavaScript');