Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why does Eclipse creates warning on HTML script tag?

I have a warning on the line including the javascript file.

<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
        <title></title>
        <script type="text/javascript" src="scripts/jquery.js"></script>
    </head>
    <body>

The warning is "Multiple annotations found at this line: - Undefined attribute name (src). - Undefined attribute name (type)."

I can't see where the problem is!

like image 669
Matthieu Napoli Avatar asked Nov 24 '10 16:11

Matthieu Napoli


2 Answers

It's the doc type. Eclipse is going to validate the DOM against the DTD. If unknown entities are not clearly defined in the DTD, then Eclipse will raise warnings.

like image 127
John Giotta Avatar answered Sep 23 '22 06:09

John Giotta


In the absence of an explicit doctype, you should check if the Property dialog for the file has a page for deciding what doctype to use as a default. HTML5 was only very recently added: http://dev.eclipse.org/mhonarc/lists/wtp-dev/msg07790.html .

like image 29
nitind Avatar answered Sep 24 '22 06:09

nitind