开发者

Cant find appropriate doctype, only seems to work in quirks mode

开发者 https://www.devze.com 2022-12-22 04:46 出处:网络
For some reason my web page seems to work fine without a doctype, but doesnt if I specify any in full.

For some reason my web page seems to work fine without a doctype, but doesnt if I specify any in full.

I have gone through various different templates without any success, i.e. code validators then dont like my开发者_JAVA技巧 code and/or it doesnt work.

The only thing "I get away with" is the top line below, but even then I cant specify any details, i.e. its just the beginning of the usual doctype declaration.

The page is the result of Drop down Stackoverflow question.

Also (and the reason why I want to specify type since this may be causing the problems) the page only fully works in IE. It only loads the first drop down in Chrome and doesnt load any in firefox.

I appreciate that above isnt overly clear, but the code is very short, so am hoping if pointed in the right direction I can complete it myself and/or describe other issues better.

<!doctype HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html lang="en" xml:lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>User Interface</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script type="text/javascript" src="dropdown.js"></script>
<html>
<body onload="show_results('','Type1')">
<form name="MainForm">
League:
<span id="FirstList"><b>First List.</b></span>
Team: <span id="SecondList"><b>Loading second list, please wait.</b></span>
<input type="button" value="Button1"  onclick="show_results(form.select_second.value,'Type3');" />
<input type="button" value="Button2" onclick="show_results(form.select_first.value,'Type4');" />
Output: <span id="OutputTable"><b>Output table space holder.</b></span>
</form>
</body>
</html>


Managed to solve it myself, even with strict type

 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">

was perfectly fine after tidying up everything.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号