How to access PHP session variables from jQuery function in a .js file? In this code, I want to get \"value\" from a session variable
$(function() {
$(\"#
If you want to maintain a clearer separation of PHP and JS (it makes syntax highlighting and checking in IDEs easier) then you can create jquery plugins for your code and then pass the $_SESSION['param'] as a variable.
So in page.php:
Then in my_progress_bar.js:
(function ($) {
$.my_progress_bar = function(percent) {
$( "#progressbar" ).progressbar({
value: percent
});
};
})(jQuery);