Frameset not showing up in FireFox or IE. Fine in Chrome..? - html

For some reason, this very basic page shows up fine in Chrome, but not FireFox or IE. I've never really needed to use Frames before, but they seem simple enough. Is there a problem with using a single frame within a frameset? I am trying to replace an iFrame with this single frame.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">
<html>
<head>
</head>
<body>
<frameset cols="*">
<frame id="aqFrameSlider" src="http://www.alphacommunications.com/alphaquote/index.php?account=J2001&hash=GISDFGSP43HAJ49FH92JSPKJ">
</frameset>
</body>
</html>

Remove <body> and close <frame> properly:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">
<html>
<head>
</head>
<frameset cols="*">
<frame id="aqFrameSlider" src="http://www.alphacommunications.com/alphaquote/index.php?account=J2001&hash=GISP43HAJ49FH92JSPKJ"></frame>
</frameset>
</html>
The next time, you should validate your document first, that would notice this error.

Related

Frameset do not work in rails 4.2

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN"
"http://www.w3.org/TR/html4/frameset.dtd">
<html>
<head>
<title> ABC </title>
</head>
This is index.html.erb
<frameset rows="170,*" frameborder="0" border="0" framespacing="0">
<frame name="topNav" src="top_nav.html" />
</frameset>
</html>
My layout is false for this view. So, html, head is declared at this view only. Question is why does not this code work in erb files?
I see only "This is index.html.erb" message on the page.
I hope everyone know that
framesets
should not come under/after body.
Problem with above code was line:
This is index.html.erb
Browser was converting taking this body tags. Removed this line from code and framesets started to appear.

Do `id` attributes need to be unique across iframes?

For instance, is this valid?
<!doctype html>
<html>
<head>
<title>Some Iframes</title>
</head>
<body>
<iframe id="frame1" src="/html/test-frame.html"></iframe>
<iframe id="frame2" src="/html/test-frame.html"></iframe>
</body>
</html>
Where the file test-frame.html has the contents:
<!doctype html>
<html>
<head>
<title>Test Iframe</title>
</head>
<body>
<button id="subscribe">Subscribe</button>
</body>
</html>
I would like to be able to use the same html and the same scripts for a set of iframes.
That's acceptable and valid. As each page is self-contained and therefore has its own individual namespace and DOM, there's no harm in using the same ID across iframes as long as it only occurs once within each iframe document.
Each page inside of an iframe is totally self-contained and unique.
You can have a page and 4 iframes, and each one can have an element called "#the-element".
Of course, the code that you have there is invalid, but if each loaded its own separate HTML, that would be perfectly acceptable.

iframes not valid in XHTML Strict

I am building a website with a Google Map, which by default generates this code:
<iframe width="550" height="500" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="http://maps.google.co.uk/maps?f=q&source=s_q&hl=en&geocode=&q=Amber,+115+Portswood+Road,+Southampton,+SO17+2FX,+United+Kingdom&aq=0&sll=50.923556,-1.394663&sspn=0.006709,0.01929&vpsrc=6&ie=UTF8&hq=Amber,&hnear=115+Portswood+Rd,+Southampton+SO17+2,+United+Kingdom&t=m&ll=50.923178,-1.393676&spn=0.012985,0.027466&z=15&output=embed"></iframe><br /><small>View Larger Map</small>
Now this throws an error when checked for XHTML Strict, as it is Frames which are outdated, but what should I use instead?
Thanks for the help
If you must have a Maps iframe on your page, the easiest solution is to change your doctype to XHTML 1.0 Transitional instead, which permits the use of iframes:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
However if you start to see any differences in page rendering (see standards mode vs almost standards mode), and you're more concerned about how your site looks in web browsers than validating your markup, just keep the XHTML 1.0 Strict doctype. Browsers won't error out simply because a page is invalid XHTML; they'll handle your iframe just fine either way.
There exists a dirty trick with Javascript:
function load()
{
document.getElementById("ramec").innerHTML = '<iframe class="ramec"></iframe>';
}
and:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="cs" lang="cs">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<script type="text/javascript" src="yourjshere.js">
</script>
<title></title>
</head>
<body onload="load()">
<div id="ramec">
</div>
</body>
</html>
The document in the first link validates as XHTML1.0 Strict, although it uses iframe inside (try the links inside the document). The important part is that Javascript which puts iframe into the document is external.
I'm not sure if it worth all the effort. Maybe changing to HTML4.1 Strict document type would be much more helpful there (the rendering of page would be the same as with XHTML1.0 Strict).
An object tag performs the same function, no hacks required. Just change the "src" attribute to "data" and add type="text/html".
<object width="550" height="500" data="http://maps.google.co.uk/maps?f=q&source=s_q&hl=en&geocode=&q=Amber,+115+Portswood+Road,+Southampton,+SO17+2FX,+United+Kingdom&aq=0&sll=50.923556,-1.394663&sspn=0.006709,0.01929&vpsrc=6&ie=UTF8&hq=Amber,&hnear=115+Portswood+Rd,+Southampton+SO17+2,+United+Kingdom&t=m&ll=50.923178,-1.393676&spn=0.012985,0.027466&z=15&output=embed" type="text/html"></object>

What is wrong with this frameset code?

I am using Webmin on my server. For some reason it's decided to stop displaying anything on the root page, it's completely blank. However it's still returning code, shown below. The individual pages in the frames work perfectly but the frameset just doesn't want to display, in any browser, for some reason.
I have stripped it right down to this, running on a local server but it still doesn't show anything:
<!DOCTYPE html public "-//W3C//DTD HTML 3.2 Final//EN">
<html>
<head>
<title>Title</title>
</head>
<body>
<frameset cols="230,*">
<frame name="left" src="test1.html" scrolling="auto">
<frame name="right" src="test2.html" noresize>
</frameset>
</body>
</html>
I've also tried removing and changing various attributes but no luck.
The <frameset> element replaces the <body> element. You can't use both in the same document.
You should write:
<!DOCTYPE html public "-//W3C//DTD HTML 3.2 Final//EN">
<html>
<head>
<title>Title</title>
</head>
<frameset cols="230, *">
<frame name="left" src="test1.html" scrolling="auto" />
<frame name="right" src="test2.html" noresize="noresize" />
</frameset>
</html>
Take out the <body></body> tag.

Frameset isn't working in IE

First of all, why use a frame set in the first place you ask?
answer: Because my boss told me.
That been said, I have 2 files. Index.html and Head.html.
Contents of index.html:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/frameset.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<title>Site Title</title>
</head>
<frameset rows="122,*" FRAMEBORDER=NO FRAMESPACING=2 BORDER=0>
<frame name="t" src="head.html" scrolling="no" marginheight="0" marginwidth="0">
<frame name="b" src="http://www.website.com">
</frameset>
<noframes>
<p>You have frames turned off on your browser, please turn it on and reload this page.</p>
</noframes>
</html>
Contents of head.html:
<div style="border-bottom:2px solid #000;height:120px">
<center>This is the frame head.</center>
</div>
The code works fine in all browsers except Internet Explorer 7 and 8 (I don't care about 6). Is there anything I am doing wrong, and if not then can the same effect be achieved without frames and if so how?
#ricebowl If you run the 2 pages you will see that the website trying to be framed does not show up at all in IE but does show up in all other browsers.
i tried in IE 7,it works well.i don't know exactly what is your problems。