Reputation: 11
When trying to validate my Home page using the W3C validator I get the following errors.
Line 13, Column 92: there is no attribute "integrity" ….js" type="text/javascript" integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo…
Line 13, Column 158: there is no attribute "crossorigin" …FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8=" crossorigin="anonymous">
This issue has only come to light following a recent program update. It seems that the developer has only just included these attributes. There is a thread (now 5 years old) relating to this and the W3C validator. Was checking and support for Integrity and Crossorigin ever added?
if($isConnected) {
echo "<script src=\"https://code.jquery.com/jquery-3.3.1.min.js\" type=\"text/javascript\" integrity=\"sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8=\" crossorigin=\"anonymous\"></script>\n";
echo "<script src=\"https://code.jquery.com/ui/1.12.1/jquery-ui.min.js\" type=\"text/javascript\" integrity=\"sha256-VazP97ZCwtekAsvgPBSUwPFKdrwD3unUfSGVYrahUqU=\" crossorigin=\"anonymous\"></script>\n";
}
else {
echo "<script type=\"text/javascript\">// <![CDATA[\nwindow.jQuery || document.write(\"<script src='{$cms['tngpath']}js/jquery-3.3.1.min.js?v=910'>\\x3C/script>\")\n//]]></script>\n";
echo "<script type=\"text/javascript\">// <![CDATA[\nwindow.jQuery.ui || document.write(\"<script src='{$cms['tngpath']}js/jquery-ui-1.12.1.min.js?v=910'>\\x3C/script>\")\n//]]></script>\n";
}
Clearly the issue is with the two attributes as if I comment out the the first part of the code above forcing the "else" branch then I get a clean validation. However in doing this the program assumes that it is running "offline" and no off site web based content such as mapping is downloaded.
Upvotes: 1
Views: 373
Reputation: 944116
Those attributes were introduced in HTML 5. The validator supports them in versions of the language which support them. XHTML 1.0 is too old.
Upvotes: 5