我有多个文件:
默认.html
<script src="/js/global.js"></script>
<script src="/js/default.js"></script>
全球.js:
var session_id=null;
默认.js:
session_id = "stuffs";
console.log(session_id); //works
chatroom.html(默认.html 中的 iframe)
<script src="/js/global.js"></script>
<script src="/pages/chatroom/chatroom.js"></script>
聊天室.js:
console.log(session_id);//doesn't work. returns
如何访问 chatroom.js 中的 session_id?谢谢你的帮助!