...

View Full Version : Jvascript - injection: create iframe on the page



jhouns
08-31-2008, 11:52 PM
okay ive been looking at javascript injection and at one point had an iframe injected into a page on a site (non permanent) then i fell asleep and forgot how i did it >.< in my attempt to redo this i have come up with this bit of code...

javascript:var iframe=document.createElement('iframe'); iframe.setAttribute("src","http://www.google.com");iframe.setAttribute("width","500px");iframe.setAttribute("height","500px");document.body.appendChild(iframe);
yes it is all in a line and yes it is supposed to be lol. When i inject this particular 'line' of javascript i dont get anything but a new page that merely says

[object HTMLIFrameElement]
ther rest of the page is blank. Any ideas on how to get the iframe to actually appear on the page so i can see it and use it?

Arty Effem
09-01-2008, 03:07 AM
Any ideas on how to get the iframe to actually appear on the page so i can see it and use it?'px' is a CSS specifier and the appendChild needs to be called using void():

javascript:iframe=document.createElement("iframe");iframe.setAttribute("src","http://www.google.com");iframe.setAttribute("width","500");iframe.setAttribute("height","500");void(document.body.appendChild(iframe));

jhouns
09-01-2008, 01:15 PM
ah thanks it worked pefectly =D i was looking at it for like a day brilliant appropriate thanks will be given.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum