javascript方法

1
2
3
4
5
6
7
8
9
10
function fireEvent(element, event) {
                if (document.createEventObject) {
                    var evt = document.createEventObject();
                    return element.fireEvent(‘on‘ + event, evt)
                } else {
                    var evt = document.createEvent("HTMLEvents");
                    evt.initEvent(event, true, true)
                    return !element.dispatchEvent(evt);
                }
  }

  

1
2
3
function filterHTML(source) {
 return !source ? "" : source.replace(/<\/?[^>]*>/g, "").replace(/[ | ]*\n/g, "\n"). replace(/\n[\s| | ]*\r/g, "\n").replace(/ /ig, "")
 }

 

javascript方法,布布扣,bubuko.com

javascript方法

上一篇:javascript的hoisting机制


下一篇:C++中的内存区域及其性能特征