How to access PHP session variables from jQuery function in a .js file?

前端 未结 7 1162
轮回少年
轮回少年 2020-11-28 10:50

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() {
   $(\"#         


        
7条回答
  •  没有蜡笔的小新
    2020-11-28 11:05

    Strangely importing directly from $_SESSION not working but have to do this to make it work :

    
    
    
    

    and in to.js

    $(document).ready(function(){
    alert(variableValue);
    // rest of js file
    

提交回复
热议问题