Troubleshooting
Problem
The HTML comment used to hide JavaScript from older browsers is ignored if it follows the SCRIPT tag directly on the same line.
Symptom
Steps to reproduce:
1. Create a new Dynamic Web Project
2. Add a new JSP file with the following content:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><%@page
language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<html>
<head>
<SCRIPT LANGUAGE="JavaScript" type="text/javascript"> <!-- Hide Script from old browsers.
// End the hiding here. -->
</SCRIPT>
<title>HtmlCommentTest</title>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
</head>
<body>
</body>
</html>
Actual result:
The HTML comment "Hide Script from old browsers." is be highlighted and will show the error 'Syntax error on tokens, delete these tokens' when hovering over it.
Expected result:
The HTML comment is shown without an error.
[{"Product":{"code":"SSRTLW","label":"Rational Application Developer for WebSphere Software"},"Business Unit":{"code":"BU048","label":"IBM Software"},"Component":"Web Tooling","Platform":[{"code":"PF033","label":"Windows"}],"Version":"7.5.5","Edition":"","Line of Business":{"code":"LOB77","label":"Automation Platform"}}]
Log InLog in to view more of this document
This document has the abstract of a technical article that is available to authorized users once you have logged on. Please use Log in button above to access the full document. After log in, if you do not have the right authorization for this document, there will be instructions on what to do next.
Was this topic helpful?
Document Information
Modified date:
16 June 2018
UID
swg21499180