When i validating my site i got following issue
<embed src="banner.swf" quality="high" pluginspage="http://www.macromedia…
✉
You have used the attribute named above in your document, but the document type you are using does not support that attribute for this element. This error is often caused by incorrect use of the "Strict" document type with a document that uses frames (e.g. you must use the "Transitional" document type to get the "target" attribute), or by using vendor proprietary extensions such as "marginheight" (this is usually fixed by using CSS to achieve the desired effect instead).
This error may also result if the element itself is not supported in the document type you are using, as an undefined element will have no supported attributes; in this case, see the element-undefined error message for further information.
How to fix: check the spelling and case of the element and attribute, (Remember XHTML is all lower-case) and/or check that they are both allowed in the chosen document type, and/or use CSS instead of this attribute. If you received this error when using the element to incorporate flash media in a Web page, see the FAQ item on valid flash.
How Can i solve this???
<embed> is deprecated, you should use <object> instead.
See http://www.w3.org/TR/REC-html40/struct/objects.html#h-13.3
embed isn't part of the HTML 4.0 or XHTML 1.0 specification (although it is part of HTML5). The object tag is the standardized tag to embed Flash and similar content in a webpage.
Related
David crockford recommends ommitting the type="application/javascript" attribute for the script tag. Should I do the same for a CSS link tag (omit "type=text/css")? I googled "html link omit mime type" and some variants and didn't find anything
Per documentation for <script>:
The type attribute gives the language of the script or format of the data. If the attribute is present, its value must be a valid MIME type. The charset parameter must not be specified. The default, which is used if the attribute is absent, is "text/javascript".
Now, let's take a look at <link>:
The default value for the type attribute, which is used if the attribute is absent, is "text/css".
The specification is not clear on this for some reason, but it does contain this:
Since that default type is text/css...
The type attribute is also purely advisory. Modern browsers definitely don't need it if it's valid CSS.
There is no practical reason to use the type attribute in either script or link elements, when you are using JavaScript and CSS, as you are (almost always). However, if there is an external requirement imposed upon you to conform to the HTML 4.01 specification, use type="text/javascript" in script, and double-check that you enter it correctly.
Those attributes are never needed (for JavaScript and CSS), but they hurt you if you misspell them. Then browsers will expect that your script is in text/javascript or your style sheet is in text/ccs and ignore it, since they do not know such languages.
In a script element, you would need a type attribute only if the content is not to be interpreted as JavaScript but e.g. as VBScript or not interpreted at all, just stored as data.
When validating my page, the W3-Validator gives me an error for every
<tag addthis:title="AddThis share title" />
attribute in my code. How can I make those attributes valid for HTML5, so the page validates? I need those tags so addthis uses the correct titles for my sharing links, so I can't get rid of them...
I'd have to assume that "addthis" is an XML namespace; does the html tag declare something like <html xmlns:addthis="..">? If not, it won't validate because the namespace is undefined for the document. If so, it won't validate because "addthis" isn't a standard namespace.
See: http://www.w3.org/TR/2011/WD-html5-20110405/namespaces.html
Confounded to your troubles is the fact that "the HTML syntax does not support namespace declarations, even in foreign elements."
Check out http://www.w3.org/TR/2011/WD-html5-20110405/syntax.html#elements-0 , the cdr:license example.
Unfortunately (in your case) HTML5 isn't XML, so XML namespaces aren't necessarily valid in HTML5. Your only real option is to ignore the validation error.
Not unrelated question: HTML5 validator failing on Facebook OpenGraph XML Namespace xmlns:og
Oh, and while you're there, the <tag /> syntax is also XML, not HTML5.
You can't make them valid. Not in HTML, not in XHTML. The only valid custom attributes allowed in HTML5 start "data-".
You could make your markup valid HTML5+something or XHTML5+something, but getting a validator to check for that is a non-trivial task.
I'm using the HTML Validator firefox add-on and when I go to the home page of http://knockoutjs.com/, I get warnings about the data-bind attribute (for the Live Example):
Examples:
<select> proprietary attribute "data-bind"
<button> proprietary attribute "data-bind"
I also get errors regarding the data-bind attribute when submitting the URL at http://validator.w3.org/.
I know this html attribute is used by knockout.js to do some data binding, but can we conclude that this approach does not follow the HTML specification? Does knockout.js follow the spirit of valid HTML markup?
They are HTML 5 custom attributes. Try to validate against HTML 5 specs and you should get an ok on the validation.
But since long you have been able to use custom attributes as you see fit although it may have violated strict HTML 4 specs.
When I read the documentation on Common-Tags, I thought it would be easy to put this in a jsp because the examples were cut and paste
<body xmlns:ctag="http://commontag.org/ns#" rel="ctag:tagged">
<span typeof="ctag:Tag"
rel="ctag:means"
resource="http://rdf.freebase.com/ns/en.u2"
property="ctag:label" content="U2"/>
</span>
</body>
It's a good thing that we're using Eclipse in our dev work. It's telling us that something is wrong with our markup. It's underlining the common-tags markup with yellow returning:
Undefined attribute name
What am I missing here? or is this completely okay?
The typeof, resource and property attributes are extensions to XHTML which are part of the RDFa specification which is why Eclipse doesn't know about them.
Since RDFa+XHTML is now a W3C recommendation this is absolutely fine to use as is.
http://www.w3.org/TR/rdfa-syntax/#rdfa-attributes
I assume you're not sending your pages with an XML MIME type, because that snippet isn't well-formed. Using RDFa isn't allowed when using a text/html MIME type. For an alternative, have a look at "microdata".
I've curious how this should be properly done.
I ran a page im working on through the w3 html validateor and I got one error message
Line 47, Column 54: Attribute "target" exists, but can not be used for this element.**
<ul><li>1000 Design PM</li>
You have used the attribute named above in your document, but the document type you are using does not support that attribute for this element. This error is often caused by incorrect use of the "Strict" document type with a document that uses frames (e.g. you must use the "Transitional" document type to get the "target" attribute), or by using vendor proprietary extensions such as "marginheight" (this is usually fixed by using CSS to achieve the desired effect instead).
any idea on how i can have a link open a new window but not use the target tag?
You can use JavaScript to open new windows, which avoids the issue of target being invalid in modern HTML.
However, this bypasses various systems people have in place to warn them about new windows (or prevent them from opening) so you are better off using the target attribute (and switching to a Doctype that allows it).
Better still is to leave it to the user to decide when they want a new window. Aside from the annoyance factor, they do introduce accessibility problems.
target="_blank"
Will not validate strict because the 'target' attribute has been deprecated.
Instead, try something similar to the aforementioned onclick workaround, but you don't need the "_blank" in there either. Simply:
1000 Design PM
Will work. The reason for the deprecation of "target" is because HTML is used to semantically mark up data whereas the target attribute was providing behaviour, which is what javascript is for.
If the user has javascript turned off then the URL will simply open in the same window.
The target attribute is not part of the Strict variants of HTML 4 and XHTML 1.0 as well as XHTML 1.1.
So you would need to use a workaround using JavaScript:
1000 Design PM
var aElems = document.getElementsByTagName("a");
for (var i=0, n=aElems.length; i<n; ++i) {
if (/(?:^|\s+)_blank(?:\s+|$)/.test(aElems[i].className)) {
aElems[i].onclick = function() {
return !window.open(this.href, "_blank");
}
}
}
Or (in the future) CSS 3 (see Hyperlink Presentation Module):
a._blank {
target: new;
}
Shouldn't it be...
target="_blank"
Regardless... You could open a new window using javascript, but that breaks the beauty of simple browsing. What if I'm browsing using Lynx or something?
According to W3C, it seems that "target" attribute is not deprecated any more in HTML 5:
The target attribute for the a and area elements is no longer
deprecated, as it is useful in Web applications, e.g. in conjunction
with iframe.
http://www.w3.org/TR/html5-diff/
Using:
target="_blank"
breaks strict XHTML validation methods. Here's a document detailing a workaround:
Instead of target="_blank" (who will never validate) you could use javascript like this:
<a onclick='window.open("./jobops/1000 Design PM.pdf", "_blank");return false;' href="./jobops/1000 Design PM.pdf">1000 Design PM</a>
Then the link will open in a new window, and your page will validate.
The users who doesn't have Javascript enabled (even though that is only about 2% of all users), will still be able to follow the link with this method. The guy's have a good point in the comments :)
Have a nice weekend everyone...