Jump to content

Invalid use of javascript tags for DOCTYPE.


rmccny

Recommended Posts

After spending the past two weeks with the W3C validator pouring over vBulletin CMS code I came across a handful of items within WHMCS that could be corrected, speaking strictly from my use of the portal theme, that is.

 

This is invalid for XHTML 1.0 Transitional.

<script language="javascript"></script>

This is valid.

<script type="text/javascript"></script>

A page with inline javascript must be wrapped in HTML comment tags to avoid validation errors with html entities (i.e. &).

<script type="text/javascript">
<!--
function foo() {
 return bar;
}
//-->
</script>

 

In the grand scheme of things they're minor errors, however complete XHTML validation for a product like WHMCS would be a good idea.

Link to comment
Share on other sites

I have not personally used that convention as XHTML 1.1 transitional will validate either way, and in fact many sites including Google don't follow it properly, but you're right, if we're going to insist on following the proper standard that is the way it should be done.

Link to comment
Share on other sites

Well then the solution is easy, don't change the code, change the DOCTYPE. Regardless of whether you think it's dead or not, the fact is that WHMCS is using a XHTML 1.1 Transitional DOCTYPE but not sending valid markup for it. Either way it's not valid to spec, so yes, the code should be changed.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated