Canman2005 Posted May 4, 2009 Share Posted May 4, 2009 Hi all I have a page with an iframe on it, the iframe is called "myiframe" What I want to do is add a javascript into my parent page so that when the page loads, it opens up the page "inside_the_iframe.html" inside the iframe Can anyone help? Tried tons of scripts but none seem to work, ideally I want to do it with something like <script>document.location='inside_the_iframe.html'; </script> Can anyone help? Thanks Dave Link to comment https://forums.phpfreaks.com/topic/156744-solved-load-page-into-iframe/ Share on other sites More sharing options...
Ken2k7 Posted May 4, 2009 Share Posted May 4, 2009 Iframes have a src attribute. <iframe src='inside_the_frame.html'></iframe> Link to comment https://forums.phpfreaks.com/topic/156744-solved-load-page-into-iframe/#findComment-825361 Share on other sites More sharing options...
Canman2005 Posted May 4, 2009 Author Share Posted May 4, 2009 Sure, but I need to be able to load a page into a iframe with a javascript, only because it's being mixed with a bit of PHP Link to comment https://forums.phpfreaks.com/topic/156744-solved-load-page-into-iframe/#findComment-825583 Share on other sites More sharing options...
Ken2k7 Posted May 4, 2009 Share Posted May 4, 2009 Give the iFrame an ID attribute. <script type="text/javascript"> document.getElementById("iFrame_ID").src = "inside_the_frame.html"; </script> Link to comment https://forums.phpfreaks.com/topic/156744-solved-load-page-into-iframe/#findComment-825709 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.