[英]Initializing a variable in script at .php page and not getting it in .js file
在我底部的.php页面中
(function ($) {
$(document).ready(function () {
var Atest = 'Hi';
$.getScript(app_consts.VIEW_JS + 'something.js');
});
})(jQuery);
在我写的something.js文件中
(function ($) {
$(document).ready(function () {
console.log(Atest);
});
})(jQuery);
并在控制台中未打印值。 我不知道该怎么做。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.