troubleshooting Question

Dynamic iframe and css in page stops the rest of webpage displaying correctly

Avatar of ossentoo
ossentoo asked on
Web Languages and StandardsJavaScriptWeb Development
8 Comments1 Solution528 ViewsLast Modified:
Hi,

I've got a problem with an <iframe> and css.  Basically, the code seems to run fine and display correctly in Firefox.  However, when I run the same page in IE 6 & 7, it does not display.  I've tried customising the css - but still the iframe does not display correctly.

If you have a look at this page, you will see the problem.

http://test.impalasoft.com/test.aspx

In Firefox, you will notice that some text ("You should view this text here"), displays after the image.  However, in IE, the text does not appear correctly.  Why is this??  

I'm trying to write the iframe using document.write so that it is created dynamically.  I'm also writing the css style using the same method.  

    document.write("<style type=\"text/css\">");
    document.write("div#frame, div#image {      float: left; margin: 0px 0px 0px 150px;}");          
    document.write("</style>");

    document.write("<div id=\"frame\">");
    document.write("<iframe src=\"https://test.impalasoft.com/serve.aspx?wid=" + wID + "&cid=" + cID + "&host="+ window.location.host + "&platform=" + window.navigator.platform + "&href=" + window.location.href + "&appName=" + window.navigator.appName + "\"");
    document.write("height=\"100\" width=\"768\" frameborder=\"0\" scrolling=\"no\"");
    document.write("Alternative text for browsers that do not understand IFrames.");
    document.write("</iframe>");
    document.write("</div>");

thanks
Oz
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 8 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 8 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros