为什么我的线程autobumper不工作?

时间:2012-10-31 18:19:39

标签: javascript

它的作用是等到页面加载,找到快速回复按钮,单击它,找到textarea,将其值更改为“bump”,单击快速回复按钮 顺便问一下,问题不在getElementsByAttribute函数中,我从我工作的另一个脚本中复制了它

window.onload=function(){

var t1=setTimeout(function(){getElementsByAttribute("src", "http://assets.bodybuilding.com/forum/bodybuilding/buttons/reply.gif")[0].click();},3000);

var t2=setTimeout(function(){getElementsByAttribute("class", "cke_source cke_enable_context_menu")[0].value = "bump";},3000);

var t3=setTimeout(function(){getElementsByAttribute("value", "Post Quick Reply")[0].click();},3000);


}



document.getElementsByAttribute = function( attrib, value, context_node, tag ) {
    var nodes = [];
    if ( context_node == null )
        context_node = this;
    if ( tag == null ) 
        tag = '*';
    var elems = context_node.getElementsByTagName(tag);

    for ( var i = 0; i < elems.length; i += 1 ) {
        if ( value ) {
            if ( elems[i].hasAttribute(attrib) && elems[i].getAttribute(attrib) == value )
                nodes.push(elems[i]);
        } else {
            if ( elems[i].hasAttribute(attrib) )
                nodes.push(elems[i]);
        }
    }
    return nodes;
}

1 个答案:

答案 0 :(得分:0)

它们具有相同的超时值,因此它们将按照它们列出的顺序触发..您在单击快速回复之前尝试单击回复..交换订单周围,它可能会工作