Redesigning website: how to get rid of framesets and how to go further? - frameset

I am trying to redesign my website, because it has a frameset, that is annoying. It annoys me because I can't see a dropdown menu and a autocomplete suggestion because of it (it overlaps it). So now, I want to get rid of this frameset, but I have frames that are very useful. So my question is: how can I get rid of the frameset, without changing the lay-out of my website? With what do I have to replace it?
<frameset id="f" border="0" rows="50,*">
<frame scrolling="no" noresize="" src="home.php?process=top" name="bar">
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang="en" dir="ltr" xml:lang="en" xmlns="http://www.w3.org/1999/xhtml">
</frame>
<frameset cols="250,*">
</frameset>

I had to admit that framesets were not working. Well, I got rid of it because there was no other way out. That simple; don't use it.

Related

How to make browsers to support self-closed xhtml tags?

Using xslt to generate web-content (QXmlQuery), the resulting xhtml page has self-closed tags, which I am unable to make browsers to understand.
The problem relates with major browsers keeping parsing the self-closed tag as if it was HTML5, thus, including following content inside the self-closed tag.
Example:
<a><xsl:attribute name="name"><xsl:value-of select="#title"/></xsl:attribute></a>
Will generate content like:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
...
<a name="Intro"/>
Some content
Which is then interpreted in the browser as:
<a name="Intro">Some content</a>
A trivial, but not elegant solution is to add a comment:
<a><xsl:attribute name="name"><xsl:value-of select="#title"/></xsl:attribute><xsl:comment/></a>
I would like to understand the problem:
Is xhtml deprecated? If this is the case, then xslt for web generation is deprecated too?
If not deprecated, how to enable proper parsing of xhtml for modern browsers? (with proper, I mean with support for self-closed tags).
I tried several DOCTYPEs, and looked about the possible xslt deprecation without results. But I have to admit that I have been out of web development for a while, forgive me if this is a trivial question.
Full example:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Title</title>
</head>
<body>
<div>
<span/>
Dummy content
</div>
</body>
</html>
Which can be seen with "Dummy content" wrongly inside span

Do I realy need this html-dtd folder for xhtml?

I asked myself, which function has a html-dtd folder with this files:
xhtml-lat1.ent
xhtml-special.ent
xhtml-symbol.ent
xhtml1-frameset.dtd
xhtml1-strict.dtd
xhtml1-transitional.dtd
I downloaded it from a German site, which recommend it when using xhtml.
Do I realy need it, if my head already looks like this?
<!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="de" lang="de">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
Maybe somebody could also explain what these files actualy do.

xhtml adding entities

I have an Website which is delivered with as xhtml (with header an doctype). I get data from the server which sometimes contains some entities what leads to an error when I try to set a string containing this via innerHTML. How I have already found out I can replace all of this items on serverside, but what I would like to know is:
Can I also add this entities to the doctype declaration instead of replacing it on server?
EDIT:
in other words, why does this:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"
[
<!ENTITY nbsp " ">
]>
just not work?
Update 2:
From http://www.w3.org/TR/2008/WD-html5-20080610/dom.html#innerhtml1 (2nd part on setting), the algorithm for XHTML does not seem to mention whether it is aware of the DOCTYPE information, though it is aware of the namespaces at least. (Note I switched to the simpler yet standards-compliant XHTML5 DOCTYPE.)
I think you might either provide the following test-case and report as a bug, or perhaps bring it up on the WhatWG mailing list, as I think the behavior should at least be spec'd(unless it is, and I am just not seeing it):
<!DOCTYPE html [
<!ENTITY nbsp " ">
]>
<html xmlns="http://www.w3.org/1999/xhtml">
<div id="a">old text</div>
<script><![CDATA[
document.getElementById('a').innerHTML = 'new text';
]]></script>
</html>
In the meantime, if you don't want to replace on the server, you could use such a hack as below with DOMParser():
<!DOCTYPE html [
<!ENTITY nbsp " ">
]>
<html xmlns="http://www.w3.org/1999/xhtml">
<div id="a">old text</div>
<script><![CDATA[
document.getElementById('a').innerHTML = new DOMParser().parseFromString(
'<!DOCTYPE html [<!ENTITY nbsp " ">]>'+
'<html xmlns="http://www.w3.org/1999/xhtml">'+
'new text'+
'</html>',
'application/xhtml+xml'
).documentElement.innerHTML;
]]></script>
</html>

Internet Explorer compability view / IIS7 issue?

My webpage code is this:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>index</title>
</head>
<body style="background-color: Black;" >
</body>
</html>
When I run the page on my development Pc (Visual Studio 2010), I get this result:
Notice that the page is rendered in compability mode.
When I run the exact same page from IIS7, I get this result:
Now the compability view is gone, but I now have a vertical scrollbar and a white frame (1-2 pixels) around the entire page (see the yellow arrows - it might be hard to see here).
Here's my questions:
Why is compability view different when running in development than on my IIS7 production server?
With the HTML code above, why is there a vertical scrollbar and a small frame around the page? ... and how do I get rid of it? I want an entire black page.
Thank you in advance!
Mojo
The use of <!DOCTYPE html> normally prevents compatibility mode, but for local files (localhost:...), IE tends to use compatibility mode despite it. To override this, use
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
(which may have various other effects too), or test your pages on a server.
put this linebefore the HTML:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

Why the select tag need at least on child to be xhtml 1.0 valid

Why the select tag need to have at least on child to be valid xhtml 1.0 ?
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>Why select tag need at least one child to be xhtml valid ?</title>
</head>
<body>
Allowed users :<br/>
<select size="5" style="width: 200px">
</select>
<br />
Alls users :<br/>
<select size="5" style="width: 200px">
<option>root</option>
<option>John Doe</option>
<option>Jane Doe</option>
</select>
</body>
</html>
To be valid, I need to write :
<select><option/></select>
I think it's useless and it's cumbersome to add the empty option tag programmatically (especially in ASP.NET WebForms, I use a DropDownList or ListBox control with a dataBind) :
if count == 0 then add <option/>...
There is no explanation in the DTD : http://www.w3.org/TR/xhtml1/dtds.html
Do you know why W3C validation require that ?
(And how can I make this page valid using a DropDownList or ListBox control in ASP.NET WebForms 4.0 ?)
Assuming that the reason this is an issue is because you are adding the options dynamically, I would suggest that also add the select dynamically, too.
In fact, you could add a node on page load...
<a name="whatever" id="whatever-id" />
and replace it with a select and options when necessary.
What would be the semantic meaning of a select without any options? You might as well not have a select...
Why? Most likely because its a standard defined approximately 10 years ago.
You should consider moving on...
Example below.
HTML5
Switch your doctype line to:
<!DOCTYPE html>
And your meta charset line to:
<meta charset="UTF-8" />
Resulting HTML Markup:
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="UTF-8" />
<title>Why select tag need at least one child to be xhtml valid ?</title>
</head>
<body>
Hello World : <select></select>
</body>
</html>
Feel free to validate in http://validator.w3.org/#validate_by_input

Resources