'height:'+ height + 'elseVariable:'+ elseVariable
the second 'height' is variable gained from window or other object.
Please see the msdn.Good luck.

解决方案 »

  1.   

    应该是'height:'+height+'...'+height+里面的是变量,其他是字符串
      

  2.   

    相当于
    printf("height:%s",height);
      

  3.   

    一般在用脚本控制新生成的页面元素的css属性时用到。<BODY>
    <button onclick="resetHeight(100)">test1</button>
    <button onclick="resetHeight(10)">test2</button>
    <br><br>
    <span style="background=blue;width:100;height:10" id=s></span>
    <SCRIPT LANGUAGE="JavaScript">
    <!--
    function resetHeight(h){
    s.outerHTML="<span style='background=blue;width:100;height:"+h+"' id=s></span>"
    }
    //-->
    </SCRIPT>
    </BODY>