[wp-trac] [WordPress Trac] #24267: JavaScript Syntax Error
WordPress Trac
noreply at wordpress.org
Sun May 5 08:40:30 UTC 2013
#24267: JavaScript Syntax Error
--------------------------+-----------------------------
Reporter: 1994rstefan | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: General | Version:
Severity: normal | Keywords: needs-patch
--------------------------+-----------------------------
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]
-->
</script>
You should use
<script type="text/javascript">
<!--
[some JavaScript]
// -->
</script>
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
--
Ticket URL: <http://core.trac.wordpress.org/ticket/24267>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list