Make WordPress Core

Opened 2 years ago

Closed 2 years ago

Last modified 2 years ago

#24267 closed defect (bug) (duplicate)

JavaScript Syntax Error

Reported by: 1994rstefan Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: General Keywords:
Focuses: Cc:


If you user HTML-Comments to hide JavaScript for browsers that do not support JavaScript, the closing HTML-Comment-Tag have to be a JavaScript-Comment

So instead of this Code:
<script type="text/javascript">
[some JavaScript]
You should use
<script type="text/javascript">
[some JavaScript]
Otherwise some Browsers will fail because of invalid JavaScript.
This is also descriped on w3schools (http://www.w3schools.com/tags/tag_comment.asp)

This error can be found in:
wp-includes/file.php on line 980
wp-includes/media.php on line 2075

Change History (3)

comment:1 @1994rstefan2 years ago

Sorry, the Wiki escapes a double slash, it should say (without space):

<script type="text/javascript">
[some JavaScript]
/ / -->

Version 0, edited 2 years ago by 1994rstefan (next)

comment:2 @ocean902 years ago

  • Keywords needs-patch removed
  • Milestone Awaiting Review deleted
  • Status changed from new to closed

No, it's valid.

Duplicate: #23952

Related: #18788

comment:3 @ocean902 years ago

  • Resolution set to duplicate
Note: See TracTickets for help on using tickets.