593访问人次
Camila Waz 2022-01-22 18:30:15
61
let dom = document.querySelector('textarea')
    dom.onkeydown = function(e){
        console.log(e.key)
        console.log(e.code)
        console.log(e.keyCode)

    if(e.keyCode == 13){
        e.returnValue = false
        console.log('禁用enter事件')
    }
}
H5页面 Camila Waz 2021-12-13 15:49:59
83
<iframe id="pdf" name="pdf" 
      src="static/web/viewer.html?file=compressed.tracemonkey-pldi-09.pdf" 
      style="width:100%; height:500px">
</iframe>
H5页面 Camila Waz 2021-06-15 17:14:53
63
<div id="text">good1230.com-专注于网站排名优化博客建站系统和好文分享</div>

let context = document.getElementById("text")
context.addEventListener('mouseup',() => {
    const selection = window.getSelection()
    const text = selection.toString()
})
H5页面 Camila Waz 2021-06-15 14:09:25
H5页面 Camila Waz 2020-09-23 17:23:14
206

字符串转数组split() 函数和数组转字符串join() 函数实例

var string="abcdefg"
console.log(string.split(''));
// 输出结果:["a", "b", "c", "d", "e", "f", "g"]

var array=["a", "b", "c", "d", "e", "f", "g"];
console.log(array.join(','));
// 输出结果:a,b,c,d,e,f,g
数组 H5页面 Camila Waz 2019-12-04 17:01:06