Greasemonkey (using the waitForKeyElements utility) - how to call a function after a specific element has been displayed on screen

女生的网名这么多〃 提交于 2019-12-01 12:31:31

Assuming the appendColumn function works, as is, on reloads; then you would rewrite it slightly and call it from waitForKeyElements().

You don't need most of that rigamorole, just use class names display and discog for the selector. Like so:

waitForKeyElements (".display.discog", appendColumn);

function appendColumn(jNode) {
    var tbl = jNode[0]; // table reference
    var i;
    var newCell, newText;    

    var tr = tbl.tHead.children[0],
    th = document.createElement('th');
    // THE REST OF THE FUNCTION IS THE SAME...
    //...
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!