1
我有multipule文件:範圍上的多個文件和iframe
default.html中
<script src="/js/global.js"></script>
<script src="/js/default.js"></script>
global.js:
var session_id=null;
default.js:
session_id = "stuffs";
console.log(session_id); //works
chatroom.html(default.html中的iframe)
個<script src="/js/global.js"></script>
<script src="/pages/chatroom/chatroom.js"></script>
chatroom.js:
console.log(session_id);//doesn't work. returns
我如何才能訪問在chatroom.js到SESSION_ID?謝謝你的幫助!