Adding doctype url causes eternal refreshing - html

I have a page that had the doctype:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
I need to add the URL to the end, or jQuery's datepicker does not display correctly. When I make the doctype say:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
The page begins to refresh it self over and over. I can't put up the code here because of NDA, but I am hoping that someone may know what would cause this to happen.
UPDATE: It looks like this doctype has problems with EasyListBox, which seems to be my problem.

The Doctype declaration shouldn't be causing the infinite refresh. It is most likely a bug in your code.

The doctype has nothing to do with that so it must be elsewhere.

Try to pare down the page so that it still replicates the error, but no longer exposes anything that might be under NDA. If you still haven't found the bug by this process of elimination, then you'll be able to post the page for us to see :)

Just try the simplest doctype ever,
<!doctype html>
the html5 doctype. It should work fine with the JQ date picker and pretty much everything else.

Doc-type and Jquery datepicker don't have a direct relationship, your problem for the refreshing loop on your page is without any doubt on your code...
Post your code or provide some link to it to allow us to help you correctly!
Ps: Doc-type does influence the way your browser reads and interpreters your page...

Related

what if i use html 5 for one webpage when total project created in html4?

I built my website in html4 and would like to add new tab(which is a link opens in new window). Would like to include videos in it and want to make this page in html5. can i make like this? What are the constraints?
Sorry for bad english and need help.
yes, since you want it opened on a new window, then it should be on a new page.
the constraints are that your html5 page should have this at the top:
<!DOCTYPE html>
and your html4 page should have something like this:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
More info on the declarations here
There won't be any constraints. The client-side browser is what will handle all of it, and HTML5 is just the term used to refer to features that modern browsers support. The only thing you might want to consider is writing it in a way where it will be backwards compatible with older clients since the rest of your site was written to support HTML4.
It is easy. Change the top line of your html file into
<!DOCTYPE html>
And then you can add html5 tags in your html page.
Yes, you can use html5 for only one page. You need to change only html declaration on
<!DOCTYPE html>
You should remember that doctype declaration must be the very first thing on your page and you can't override it
There are no constraints..In fact you could change all your pages to HTML5 and your HTML 4 code will still work the same as before. No need to change anything as html 5 is fully backward compatible,i.e. html 4 elements work fine in it.

How can I tell if the following Web page source code is XHTML, HTML or XML?

I am working with this Web Page for improving my programming skills:
http://www.studenti.ict.uniba.it/esse3/ListaAppelliOfferta.do
If you take a look at its source code, you can see HTML peculiar tags like
<head> <body> <title>
The question is: I am quite sure this page is not in XML, so is it simple HTML or XHTML?
According to my knowledge those two are quite similar.
How can I tell which of the two it is? If I must choose I'd say simple HTML (5 or 4) but I am not 100% sure!
Look for a Doctype declaration at the very beginning of the document.
If it is XHTML, the doctype will look like this:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
If it is HTML5, it will look like this:
<!DOCTYPE html>
See the W3 Spec for information on Doctype. More information here at the Mozilla Developer Network, too.
The Website you linked has <!DOCTYPE html> declared, which instructs the browser to interpret the document as HTML5 markup.
The <!DOCTYPE html> declaration indicates that it is HTML5. Of course, it might not actually be HMTL5, but it's claiming that it is. The only way to be sure is to run it through an HTML5 validator.

Why and how to use <!DOCTYPE>? [duplicate]

This question already has answers here:
Closed 11 years ago.
Possible Duplicate:
What's up, Doctype?
HTML: What is the functionality of !DOCTYPE
Okay, when I first learn HTML, I basically learn from trial and error as I went along, and didn't really sit down to properly learn it as far as I can remember. As a result of this, I've missed out a lot, and therefore, I've decided to start from the basics for my own benefit. :) So here I am, (re-)learning HTML.
Now, my question - the <!DOCTYPE> tag confuses me more than any other HTML tag I've ever come across, so I've come here to clear up any questions I have regarding it so I can use it confidently. :)
Firstly, can someone explain to me why it's necessary to use a <!DOCTYPE> tag in your webpages? They work fine without them, don't they? I've read that it is so it can be validated against the standards of the W3C, but that's all I know. A little more detail would be appreciated. :)
Secondly, after reading up on it, I'm still confused as to what exactly goes in my <!DOCTYPE> and how to type it out. For example, this is one kind of DOCTYPE I've seen used:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
Yet I've also seen other variations, and from what I've read, there are different DOCTYPES to validate against - it's all so very confusing, which should I use in my webpages if I was going to use one?
W3C has a pretty good answer to this at http://www.w3.org/QA/Tips/Doctype
Why?
Why specify a doctype? Because it defines which version of (X)HTML
your document is actually using, and this is a critical piece of
information needed by some tools processing the document.
For example, specifying the doctype of your document allows you to use
tools such as the Markup Validator to check the syntax of your
(X)HTML. Such tools won't be able to work if they do not know what
kind of document you are using.
But the most important thing is that with most families of browsers, a
doctype declaration will make a lot of guessing unnecessary, and will
thus trigger a "standard" rendering mode.
Basically if you leave it out, the browser will try and guess what rendering mode to use, and it might cause some unexpected results.
it basically tells the browser how to interpret the page you're sending it. If you don't send anything, it has to make guesses. Some constructs are valid in a format while invalid in others, etc. Some browsers may display your page correctly while others don't. So yes, do choose and send a DOCTYPE.
There are several doctypes you can use, xhtml, html strict, html transitional, 4.01, etc. You can see a list of valid types here ... http://www.w3.org/QA/2002/04/valid-dtd-list.html
The declaration refers to a Document Type Definition (DTD). A DTD specifies the rules for the markup language, so that the browsers render the content correctly.
Going forward, for html5 compliance, the correct tag is simply:
<!DOCTYPE html>
You set a doctype to say to your browser or somthing else what you going tho do. Its look like what you do whit a business card
There are several doctype's. The most yoused doctype's are transitional:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/ xhtml1-transitional.dtd">
The some stricter doctype is: (see "strict")
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
Also you can youse a speciffie doctype declaraition for youse a frameset. But this is outdated, frameset is a unnecessary for my but i will show you the doctype for this. But forgot the framesets this is an not useful html element whit html5. Here see you the follow frameset doctype:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
And at last. You can youse a language attribuut for your the doctypes. This can youse by html and xhtml.
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

The HTML Doctype is automatically changing from XHTML 1.2 to XHTML 1.0

On a html page the doctype I've used is as follows (for a mobile website):
<!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.2//EN"
"http://www.openmobilealliance.org/tech/DTD/xhtml-mobile12.dtd">
which after uploading on the web server automatically turns into
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
To make it clear this change happens as soon as I save the page on the server. (using cPanel)
Any idea on what could be the reason for this (automatic) change?
Because of this the layout of the page is not coming out as I expect it to be on some browsers.
Ok, I think I've figured out the exact problem, it happens only when I use the cPanel editor to edit the html page and not when I just upload the file and not open it in their editor. As Jeremy said in the comments below the question, it's cPanel changing (screwing?) it for me!
Thanks a lot everyone, especially Jeremy! :)
btw should I now delete this question or keep it as someone else might also face similar issue?

Does having multiple <HTML> element tags on one page cause problems

I cam accross this specific situation today. On a client's website, the pages had multiple tags, some even with conflicting Doctypes:
Ex:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html><head>....</head></body>...</body>
</html>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html><head>....</head></body>...</body>
</html>
All this within the same page.
Will this cause any issues, if so which ones ?
The problem that this will cause is that it is invalid HTML and it is indeterminate how the content will be rendered.
This is pretty much the standard "web" answer, but basically it depends on how the browser handles it. It's obviously not standards-compliant HTML so it would be good to avoid it.
apart from that it is plain ugly and non-standard,
it has surely caused browser hickups in browser before, i dont know how the common browsers behave today.
i recall the day when one experimented with multiple body tags with different bgcolors to create a blinking background effect :)