Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

JavaScript Forum


You are currently viewing our JavaScript Forum as a guest. Please register to participate.
Login



Reply
Problem with Javascript Iframe
Old 03-20-2012, 12:00 PM Problem with Javascript Iframe
PBScott's Avatar
Extreme Talker

Posts: 175
Name: Scott
Location: Canada
Trades: 1
Hi all,

In order to try get the main part of my website to load before an IFrame, I am using a javascript code to try and fire the Iframe after the main page's onload event.

I have this code that works perfectly in Firefox, Safari, Opera and Chrome, but I am unable to get it to run in IE. In IE the page loads fine but the Iframes do not.

Could someone please tell me where I am going wrong here, and hopefully a working solution I can try cutting and pasting into my website.

Here is the page that contains the code:

http://planetarybargains.com/Consume...rt%20Black.php

Thanks in advance.

Code:
<!--Clothing FrameInsert Start -->
<div id="products01">
<script>
//doesn't block the load event
function createIframe(){
  var i = document.createElement("iframe");
  i.src = "Artistic T-Shirts Frame New.php";
  i.scrolling = "no";
  i.frameborder = "0";
  i.border = "none";
  i.width = "1007px";
  i.height = "1615px";
  i.style.border = "0px";
  document.getElementById("products01").appendChild(i);
};
    
// Check for browser support of event handling capability
if (window.addEventListener)
window.addEventListener("load", createIframe, false);
else if (window.attachEvent)
window.attachEvent("onload", createIframe);
else window.onload = createIframe;

</script>
<!--Clothing FrameInsert End -->
</div>
__________________

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

Last edited by PBScott; 03-20-2012 at 12:49 PM..
PBScott is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 03-20-2012, 12:08 PM Re: Problem with Javascript Iframe
PBScott's Avatar
Extreme Talker

Posts: 175
Name: Scott
Location: Canada
Trades: 1
I really hope some coding guru will come on here and find the fix for me. So far 100 people have looked at this and no answer, I am sure it is just a syntax error somewhere.

Last edited by PBScott; 03-20-2012 at 03:36 PM..
PBScott is offline
Reply With Quote
View Public Profile
 
Old 03-21-2012, 12:45 AM Re: Problem with Javascript Iframe
PBScott's Avatar
Extreme Talker

Posts: 175
Name: Scott
Location: Canada
Trades: 1
I have solved this problem by eliminating some superfluous code.
__________________

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

Last edited by PBScott; 03-21-2012 at 12:51 AM..
PBScott is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Problem with Javascript Iframe
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.45549 seconds with 11 queries