tags:

views:

52

answers:

4

Hello, A Iframe is dynamically add just after BODY tag and it breaks my all site, So i want to find IFrame which is just after BODY tag and remove it using JQuery. It also adds some Js so, i want also to remove this. Please help me.

HTML Markup

<body>
<iframe></iframe>
<script type="text/javascript">
//<![CDATA[
(function(){
var c = document.body.className;
c = c.replace(/no-js/, 'js');
document.body.className = c;
})();
//]]>
</script>
A: 

Try

$("#conash3D0").remove();
rahul
+3  A: 
var el = document.getElementsByTagName("iframe")[0];
el.parentNode.removeChild(el);
​

or if the #id is static

$("#conash3D0").remove();
galambalazs
+1  A: 

You could use the .remove() function:

$(function() {
    $('#conash3D0').remove();
});
Darin Dimitrov
+5  A: 

Instead of just removing it from jquery you need to check the rest of your site. You're a victim of an ifram injection attack. You should check your server and the machines you use to connect to it via FTP for any malware.

Take a look at these:

http://www.diovo.com/2009/03/hidden-iframe-injection-attacks/
http://faiz.kera.la/2009/04/12/server-side-code-cleaner-in-aspnet-for-iframe-injection-attack/

Ritik Khatwani
Thanks for sharing me a nice information.
saorabh