1.

Solve : Iframe not working in Firefox?

Answer»

Hi guys,
I have a website called the Virtual Company Project, and on one of the pages I have an iframe that is visibility: hidden; until it is called to be shown by a javascript function. Shown below:



Basically, it is an empty iframe, and then a USER clicks on the 'graph' link and it tells the iframe to go to a web address (in this case www.vcp.co.nz/vcp/stockgraph.php?company=whatever) and then makes it VISIBLE centrepage.

However, in firefox, this is not working. If you click graph? it just doesn't appear.

It *does* work in Chrome, Opera, Safari, and Internet Explorer 7/8/9.

The specific code:

What isn't appearing:
Code: [Select]<iframe id="GraphFrame" frameborder="0" vspace="0" hspace="0" marginwidth="0" marginheight="0" allowTransparency="true"
width="90%" scrolling="no" height="420" style="BORDER-RIGHT: none; BORDER-TOP: none; Z-INDEX: 500; LEFT: 20px; BORDER-LEFT: none; BORDER-BOTTOM: none; POSITION: fixed; TOP: 100px; visibility:hidden;">
</iframe>
<div id='CloseGraphFrame' width='20' height='10' style='position: fixed; top: 0px; right: 0px; visibility: hidden; z-index: 501;'>
<a id='boldme' onclick='CloseGraph()'>Close</a></div>
The code that calls it:

Code: [Select]function ShowGraph(company)
{
document.all.GraphFrame.src='http://www.vcp.co.nz/vcp/stockgraph.php?company=' + company;
document.all.GraphFrame.style.visibility="visible";
document.all.CloseGraphFrame.style.top = document.all.GraphFrame.style.top;
document.all.CloseGraphFrame.style.right = document.all.GraphFrame.style.right;
document.all.CloseGraphFrame.style.visibility="visible";
}

Any ideas?
Thank you for asking. I've been pushing to get a word out about web coding
standards and your question might help me do that.

W3C at

w3c.org

has a validator to check the HTML coding to the current HTML standards
and outputs a suggestion to fix the problem if it fails.

Your page has 8 errors and 3 WARNINGS.

see here:

http://validator.w3.org/check?uri=http://www.vcp.co.nz/vcp/stockgraph.php?company=whatever&charset=%28detect+automatically%29&doctype=Inline&group=0

Hopefully fixing the errors and warnings will fix your IFRAME problem.

Could you give it a try? I'll watch this space to see how it works out!

Andre



Discussion

No Comment Found