Why doesn't document.addEventListener('load', function) work in a greasemonkey script?

前端 未结 5 1574
粉色の甜心
粉色の甜心 2020-12-05 22:32

It doesn\'t give an error, and I put a console.log(\'loaded userscript wifi-autologin\'), the console.log works, but the intended effect of the doc

5条回答
  •  忘掉有多难
    2020-12-05 23:02

    To get the value of my drop down box on page load, I use

    document.addEventListener('DOMContentLoaded',fnName);
    

    Hope this helps some one.

提交回复
热议问题