+ -
当前位置:首页 → 问答吧 → 在非IE浏览器中,带下滑线的变量如何访问

在非IE浏览器中,带下滑线的变量如何访问

时间:2011-11-26

来源:互联网

例如:
js文件中
var _stylePath = null//图片所在的路径
var _curentFrame = null;//当前框架的ID
var _curentUrl = null; //当前框架的地址
var _isShowCloseBtn = null;
function test()
{
 _stylePath ="main/main.css"
 alert(_stylePath )
}

在html中
<td>
<script>
  var t = new test();
</script></td>

在chrome浏览器中,无法弹出正确读取_stylePath的值.

作者: alexsongff   发布时间: 2011-11-26

我这边没问题,你其他代码错误导致js不能解释执行吧

HTML code
<body>
<script>
var _stylePath = null//图片所在的路径
var _curentFrame = null;//当前框架的ID
var _curentUrl = null; //当前框架的地址
var _isShowCloseBtn = null;
function test()
{
 _stylePath ="main/main.css"
 alert(_stylePath )
}
var t = new test();
</script></body>

作者: p2227   发布时间: 2011-11-26

热门下载

更多