Welcome Guest, Not a member yet? Register   Sign In
CI more javascipt related!
#1

[eluser]the_unforgiven[/eluser]
I need to know how to put something like $_SESSION['sess'] into some javascript

Code:
data.addRows([
          ['Visits', 10]
        ]);

Where the number 10 is where i want to store the session var to show visits for today

how can it be done?
#2

[eluser]beaudierman[/eluser]
Do you want to just display that session variable's value in your JavaScript? If so, this will get the job done as long as you have the session library loaded:

Code:
data.addRows([
          ['Visits', <?php echo $this->session->userdata('sess') ?>]
        ]);
#3

[eluser]the_unforgiven[/eluser]
Gracias, much appreciated! What i thought it was just needed to check!




Theme © iAndrew 2016 - Forum software by © MyBB