PDA

View Full Version : Removing code from a site shown within a frame



DrLacero
03-08-2008, 11:13 PM
My friend and I are currently working on a project the main part of which would be displaying webpages within our site but I have a question:

There are certain objects within the pages we wish to display that we want to remove without going through every single page that would be used (as there are thousands of them) and remove them manually, is there a code we could put somewhere that would remove certain parts or block them from being loaded?

Thanks

Agnostic Bear
04-08-2008, 09:09 AM
If you loaded it using js and put it in a div (ajax if you want) then yes, but an iframe, not that I know of. Give it a test, something like this I'd assume:

var theframe = document.getElementById('iframeid').innerHTML;
var thehtml = theframe.replace(/whatever/i, 'whatever');
document.getElementById('iframeid').innerHTML = thehtml;

I think something like that should do it for an iframe, I'm not sure though.

DrLacero
04-08-2008, 10:42 AM
If I did it with javascript would the external page that loads still let you log in (as it may require it)?

Want to hide these adverts? Register an account for free!