javascript - 在我的脚本块上获取无法访问的代码
问题描述
正文中脚本块开头的“如果”在 Intellij 中一直被识别为无法访问。我不知道为什么。有任何想法吗?
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head><%@ page isELIgnored="false" %>
<meta charset="ISO-8859-1">
<style>
<%@include file="/css/success.css" %>
</style>
</head>
<Title>Logged In Successfully</Title>
<body>
<div class="message">
<h2>${login.message}</h2>
</div>
<script>
if(${AdminCheck.adminCheck} === true){
document.write("<form action=\"http://example.com:8080/table\">" +
"<input class=\"showTable\" type=\"submit\" value=\"View Users\"/>" +
"</form>");
}else{
document.write("<form>\n" +
"\t<input class=\"adminVerification\" type=\"text\" id=\"verify\" name=\"adminVerification\" placeholder=\"Password\"/>\n" +
"</form>");
var check = document.getElementsByName("adminVerification");
if(check.value === "IamADMIN"){
document.write("<form action=\"http://example.com:8080/table\">" +
"<input class=\"showTable\" type=\"submit\" value=\"View Users\"/>" +
"</form>");
document.getElementsByName("adminVerification").style.display="none";
}
}
</script>
</body>
</html>
更新:原来脚本正在运行,我将一些条件值更改为多余的真或假,它们可以正常工作。IntelliJ 仍然进行了一些奇怪的分析,说它无法访问。不知道为什么它会抛出那个。
解决方案
但它是否运行并且 IntelliJ 错误地将其识别为无法访问?或者它实际上是无法到达的?
此外,标题标签位于头部和主体之外,这可能会使 IntelliJ 感到困惑
推荐阅读
- r - 如何使用 if 条件检查多个值
- amazon-web-services - 从 ListGroupsAsync 函数中使用 C# .net 中的 AWS cognito 检索组列表?
- ruby - Trailblazer 在验证前解析数据:populator
- python-3.x - while-if-elif 上的“无效语法”?
- json - Json 到 Excel(多级)
- scala - 实体不会自动重定位到加入的节点
- python - 如何用空虚和虚线虚线符号绘制散点图?
- python - 如何从字典列表中删除重复的短语?
- python-3.x - python 3 Tkinter Checkbutton值
- extjs - ExtJS 6.6 的 Jasmine 测试