Jump to content

javascript into a session??


essjay_d12

Recommended Posts

javascript can be put in a session variable, but only as text, and it can only be accessed and printed out server side, and then will execute browser side:

 

server side code:

<script type="text/javascript">
    <?php echo $_SESSION['myjs']; ?>
</script>

if the session variable 'myjs' contained:

alert('hello'); 

it would echo into the page server side and then execute browser side

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.