例如:
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的值.

解决方案 »

  1.   

    我这边没问题,你其他代码错误导致js不能解释执行吧<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>