相关文章:

JavaScript String.concat() 函数详解

代码类型:

杂项:

  • 启用CSS/JS语法检查
  • 监测脚本运行错误
  • 禁止库文件重复

文档类型:

JS库文件:

手动添加:

     
    1
    xxxxxxxxxx
    17
     
    1
    //在当前页面内追加换行标签和指定的HTML内容
    2
    function w( html ){
    3
        document.body.innerHTML += "<br/>" + html;
    4
    }
    5
    6
    /* str1.concat(str2) 相当于 str1 + str2 */
    7
    8
    9
    var str = "CodePlayer";
    10
    str = str.concat(",http://www.365mini.com");
    11
    w( str ); // CodePlayer,http://www.365mini.com
    12
    13
    str += ",Play";
    14
    w( str ); // CodePlayer,http://www.365mini.com,Play
    15
    16
    str = str.concat(",a", ",b", true);
    17
    w( str ); // CodePlayer,http://www.365mini.com,Play,a,btrue
    xxxxxxxxxx
    1
     
    1