0

I have problem I had recieved from one popup site a javascript js code silmar to this url

<script src="anysite.com/popurl.js"></script>

to earn money bot after a while this site used iframe in its js code i need a java script code to disable iframe in this js code do you have any javascript to disable iframe in js code ??? please help me.

at the end of this js that i had recieved is an iframe silmar to this code

document.write('<iframe width=0 height=0 src="'+thisurl+'"></iframe>')
  • 1
    like [this](http://stackoverflow.com/questions/2207501/stopping-a-iframe-from-loading-a-page-using-javascript)? – Kevin Kloet Nov 17 '16 at 12:55
  • if in the page we have more than 2 iframe and we want to cancel just one iframe in the js code and after the js code we have several iframe that we dont want to cancel what can we do ?? – Mahsa Salehamin Nov 17 '16 at 13:50
  • `window.frames[0].stop()` stops only the first frame, and for example `window.frames[2].stop()` stops the third frame. – Kevin Kloet Nov 17 '16 at 13:54
  • example the down code ?? js have an iframe /// and the iframe up of the code will not cancel yes /// it meens the first iframe after cancel code will be cancel ??? – Mahsa Salehamin Nov 17 '16 at 14:14
  • `window.frames[0].stop()` cancels the first frame it sees on the dom, so if you have 2 frames, one at the top of your dom and one at the bottom, the top one will stop. – Kevin Kloet Nov 17 '16 at 14:34

1 Answers1

0

my code will be this for first iframe ??

 <iframe id=0 src="??"></iframe>

     <SCRIPT>
    if (typeof (window.frames[0].stop) === 'undefined'){
        //Internet Explorer code
        setTimeout(function() {window.frames[0].document.execCommand('Stop');},1000);
    }else{
        //Other browsers
        setTimeout(function() {window.frames[0].stop();},1000);
    }
</SCRIPT>
     <script
    document.write('<s'+'cript src="http://anysite/code.js"></s'+'cript>');
    </SCRIPT>
    <iframe id=2 src="??"></iframe>

the js code have the id=1 so the iframe id=2 will not be cancel till the frame[0] if we want to cancel second iframe we must do frame[1] correct ?? and the iframe id=0 will not cancel because its before the code