I'm not sure why this is happening. I'm just setting up a basic site, I've barely added anything, but Chrome seems to think i'm trying to use frames?
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title></title>
</head>
<body>
<div id="header">
<div id='logo'><img src='img/logo-black-thin.png' /></div>
</div><!--header-->
</body>
</html>
But for some reason in Chrome it creates a bunch of frameset tags and gives me this sentence in the html:
Your browser does not support frames. We recommend upgrading your browser.
I can't figure out why this is happening. Any ideas?
Related
I'm sorry, but I am not very good with programming. I am trying to fix this irritating bug on my school's website through a userscript. I have tested the RegEx on several pages, at least that works. I need to make the userscript remove the parts I don't want to see. This is a snippet from the source of the website, I have marked what needs to be removed with '//'.
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
//<html><head>
//<title>404 Not Found</title>
//</head><body>
//<h1>Not Found</h1>
//<p>The requested URL /get.php was not found on this server.</p>
//</body></html>
<!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" xml:lang="en-gb" lang="en-gb" >
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<meta name="robots" content="index, follow" />
This is my userscript that does not work. I know it reflects my skills as a programmer, please don't hate.
var REGEX = /<HTML>(.*?)([^\n]*?\n+?)+?<\/BODY><\/HTML>/ig;
document.body.innerHTML=document.body.innerHTML.replace(REGEX, '');
This markup is obviously invalid, but the browser (at least Chrome and Firefox) will merge these two <html> sections together with its best guess. So interacting with document.body is probably not what you want.
Doing something like this will visually fix the issue:
document.querySelector('h1').remove() // remove first h1 "Not Found"
document.querySelector('p').remove() // remove first p "The requested..."
Hi all:
I want to get the autual height of the web browser,but I got some confusions about the W3C DTD HTML 4.01 and //W3C//DTC XHTML 1.0,below is my issue detail:
If I am using W3C DTD HTML 4.01 at the top of the page header and use document.body.clientHeight,then I can not get the full height of the browser:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Test jQuery Height</title>
<script type="text/javascript" src="../lib/jquery-1.8.3.min.js"></script>
<script type="text/javascript">
$(function(){
var height=document.body.clientHeight;
alert(height);
})
</script>
</head>
<body>
<div style="margin-left:30px;">
<button>Start Select</button>
<button>Stop Select7lt;/button>
</div>
</body>
</html>
But if I change to //W3C//DTD HTML 4.01 or use document.documentElement.clientHeight,then I could get the actual height of the browser:
1. Using //W3C//DTD HTML 4.01
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Test jQuery Height</title>
<script type="text/javascript" src="../lib/jquery-1.8.3.min.js"></script>
<script type="text/javascript">
$(function(){
var height=document.body.clientHeight;
alert(height);
})
</script>
</head>
<body>
<div style="margin-left:30px;">
<button>Start Select</button>
<button>Stop Select7lt;/button>
</div>
</body>
</html>
Using document.documentElement.clientHeight
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Test jQuery Height</title>
<script type="text/javascript" src="../lib/jquery-1.8.3.min.js">
</script>
<script type="text/javascript">
$(function(){
var height=document.documentElement.clientHeight;
alert(height);
})
</script>
</head>
<body>
<div style="margin-left:30px;">
<button>Start Select</button>
<button>Stop Select7lt;/button>
</div>
</body>
</html>
So,my question is What's the difference between "//W3C//DTD HTML 4.01" and "//W3C//DTD XHTML 1.0"?
Any help will be grateful!
The difference between “//W3C//DTD HTML 4.01” and “//W3C//DTD XHTML 1.0” is that the former has “HTML 4.01” as opposite to “XHTML 1.0” in the latter.
What you have actually observed is the difference between the two document type declarations
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
and
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
The former puts browsers to “standards mode”, whereas the latter puts them to “quirks mode”. In quirks mode, strange things may and will happen. This may include nonstandard calculation of widths and heights.
Unless this is about a legacy page that relies on quirks mode, you should use “standards mode” and use CSS and DOM by the specifications.
The HTML 4.01 strict doc type i.e "-//W3C//DTD HTML 4.01//" , validates against the HTML 4.01 spec, although it doesn't allow any presentation markup or deprecated elements (such as font elements) or framesets to be used. It validates loose HTML style markup, such as minimized attributes and non-quoted attributes (eg required, rather than required="required")
The HTML 4.01 transitional doc type i.e "-//W3C//DTD HTML 4.01 Transitional//EN" validates against the HTML 4.01 spec. It allows some presentation markup and deprecated elements (such as font elements) but not framesets. Again, it validates loose HTML style markup
These are the exact XHTML 1.0 equivalents of the HTML 4.01 doctypes i.e "-//W3C//DTD XHTML 1.0 Transitional//EN" or "-//W3C//DTD XHTML 1.0 Strict//EN" we discussed above, so functionally they are the same, except that they won't validate loose HTML style markup: it all needs to be well formed XML.
Here is a good comparison of these two document standards: http://www.w3.org/TR/xhtml1/diffs.html
In short: with XHTML you have to follow the XML structure, just as with any other XML document. HTML4 Transitional is more flexible and allows e.g. usage of additional attributes in tags or skipping of some attributes.
EDIT:
document.documentElement seems to work in IE standard mode
document.body in IE quirks mode and all other browsers I usually use.
document.body is more of a standard than the other one. But it does not relate to the (X)HTML standard.
I am currently working on a project on web designing using Dreamweaver. So I have set up my site and home.html. I've also added the necessary images in an images folder in the project root.
Here’s the problem: when I drag the image from my assets panel and put it in design, the image doesn't show up, but I see a grey box and an icon in it. Now when I see the live view, I can see the image.
How can I see the image in design view, so as to adjust its size proportionately?
This is my code:
<!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>home</title>
</head>
<body>
<img src="images/webDes.jpg" alt="" width="280" height="226" longdesc="images/webDes.jpg" />
</body>
</html>
ok ,I got the problem . the image was made in illustrator, and when I exported it in .JPEG format , I chose CMYK. that was the wrong move , I Later exported again , but chose RGB and it worked !
Your code has errors in it, possibly attributing to Dreamweaver not showing the images. Your web browser may be ignoring the errors, but dreamweaver isn't. HTML does not require colons, which you have two of. Here is come cleaned-up code.
Cleaned up your code a bit - try this.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "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>home</title>
</head>
<body> <img src="images/webDes.jpg" alt="" width="280" height="226" longdesc="images/webDes.jpg" />
</body>
</html>
Heres what I tried...
In Main html page....
<iframe src="./example.html" id="frame" frameborder="1"></iframe>
and example.html looks like this..
<!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>
<title>Example</title>
</head>
<body>
<p>YOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO</p>
</body>
This results in empty iframe.
--UPDATE--
Ok,the problem was that simply refreshing the page did not update the iframe. but when I clsed it and reopened it it was fine. Can someone explain this? Do iframes need to be refreshed?
Example.html should be:
<!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>
<title>Example</title>
</head>
<body>
<p>YOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO</p>
</body>
</html>
Also make sure your path to example.html is correct in your iframe, as well as having a set height & width.
I have a bunch of html help files and my boss wants them to be all in one giant file as well, for printing. I want to just embed them all into a single html page and I need the <object/> to auto-size to fit the entire page within the page.
doing it this way:
<object type="text/html" data="My.html"/>
Open to doing it another way if anyone has better suggestions, but this is just a real simple task so I want to keep it as simple as I can.
Thanks all!
EDIT:
This is all the html I'm using just for testing purposes.
<!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 content="text/html; charset=utf-8" http-equiv="Content-Type" />
<title>Default</title>
</head>
<body>
<iframe style="height:100%;width:100%" src="test.html"/>
</body>
</html>
The embedded document:
<!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 content="text/html; charset=utf-8" http-equiv="Content-Type" />
<title>Default</title>
</head>
<body>
<p>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa</p>
<p>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa</p>
<p>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa</p>
<p>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa</p>
<p>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa</p>
<p>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa</p>
<p>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa</p>
<p>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa</p>
<p>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa</p>
<p>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa</p>
</body>
</html>
Use :
<object style="width:100%;height:100%;" type="text/html" data="My.html"/>
That works for me (IE 9.0, Firefox 7.0.1).