This variable is in a .php view
<?php $actualizar=$_SESSION["actualizar"]; ?>
This is in a .js file we are working under the mvc model
$( document ).ready(function() {
// the "href" attribute of the modal trigger must specify the modal ID that wants to be triggered
$('#modal2').modal({
dismissible: false, // Modal can be dismissed by clicking outside of the modal
inDuration: 3000, // Transition in duration
outDuration: 200, // Transition out duration
startingTop: '4%', // Starting top style attribute
endingTop: '10%', // Ending top style attribute
});
$('#modal2').modal('open');
});
any idea how to capture that session variable in jquery ?
Do you have the possibility to save it in a cookie instead of a session? Sessions cannot be obtained directly with JS but cookies can.
Having:
In JavaScript you can get
$_COOKIE['actualizar']
like this: