darklexus2k9 Posted August 29, 2012 Share Posted August 29, 2012 Hi all i am creating a chrome extenshion and i have it all working good but there is one problem the code i had to try remove a <frame> eliment was wrong can some one help me remove the <frame> eliment ? there are 3 of them in the page but the one i want to remove is : <frame src="view.php" name="view"> does anyone know the code i would need to remove this <frame> from this page or even jus change its url to about:blank i really need help with this i have been searching google and all the code i try does not work :/ i am not the best with javascript Quote Link to comment https://forums.phpfreaks.com/topic/267756-remove-eliment-from-page/ Share on other sites More sharing options...
Mahngiel Posted August 29, 2012 Share Posted August 29, 2012 is it an iframe or part of a frameset? Quote Link to comment https://forums.phpfreaks.com/topic/267756-remove-eliment-from-page/#findComment-1373642 Share on other sites More sharing options...
codefossa Posted August 29, 2012 Share Posted August 29, 2012 This should work, but untested. if (window.document.getElementsByTagName("frame") != undefined) { var tag = window.document.getElementsByTagName("frame"); for (var x in tag) { if (tag[x].name != undefined) { if (tag[x].name == "view") tag[x].parentNode.removeChild(tag[x]); } } } Quote Link to comment https://forums.phpfreaks.com/topic/267756-remove-eliment-from-page/#findComment-1373651 Share on other sites More sharing options...
darklexus2k9 Posted August 29, 2012 Author Share Posted August 29, 2012 is it an iframe or part of a frameset? this is a frame that shows a webpage every few mints but it does not have the iframe tag just plain old frame Quote Link to comment https://forums.phpfreaks.com/topic/267756-remove-eliment-from-page/#findComment-1373661 Share on other sites More sharing options...
Christian F. Posted August 29, 2012 Share Posted August 29, 2012 darklexus2k9: The first step of getting help with your code, is to actually post your code. Second step is to explain, in a clear and concise manner: 1) What you want to do. 2) What you expected the code to do. 3) What it actually did. Preferably with actual examples as well, so that we can see the flow of logic for each step. Quote Link to comment https://forums.phpfreaks.com/topic/267756-remove-eliment-from-page/#findComment-1373682 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.