【 在 westsand (珍惜闪光) 的大作中提到: 】
: 标 题: 我在js文件里判断html里直接script的变量,为什么有时候判断不
: 发信站: 水木社区 (Fri Mar 28 15:21:13 2008), 站内
:
: 1.html
:
: <html>
: <script>
: var a=TRUE;
true
你的a定义就失败了。。当然之后不行了
: </script>
:
: <script src=2.js type="text/javascript"></script>
:
:
: 2.js:
: if (!window.a) {
: alert('不存在');
: }
:
: 问题是:为什访问1.html时候,明明a在script已经定义为TRUE,为什么2.js执行的时候还会执行到alert('不存在');
: 不是总出现,为什么有这个问题
:
: --
:
: ※ 来源:·水木社区 newsmth.net·[FROM: 124.207.144.*]
--
FROM 202.108.12.36