我使用Intellij Idea。我想下载jquery库以在Spring项目的Intellij Idea中离线访问它。所以我在链接上输入了“ Alt + enter”
<script src="https://code.jquery.com/jquery-1.12.4.min.js"></script>
Run Code Online (Sandbox Code Playgroud)
并选择“下载库”。该库已下载,问题是在它运行之后,我无法运行我的程序,因为一直以来我都看到错误:java:索引4:http:\ api.jquery.com上的char <:>非法,没有任何路径。我什至在整个项目中都没有写过类似的东西。
当我只有全局链接到“ https://code.jquery.com/jquery-1.12.4.min.js ”并可以正常访问Internet时。
我试图从intellij删除库后,将库下载到本地文件中,并实际上放置了标头链接。但仍然不起作用。
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<script src="https://code.jquery.com/jquery-1.12.4.min.js"></script>
</head>
<body>
<input type="number" id="myInput" name="myInput" onchange="countOfTryings(this)">
<a name="toChallenge" href="http://some_web_site.com?parameter1=4">This is link</a>
<a name="toChallenge" href="http://some_web_site_other.com?parameter1=4">This is link 2</a>
<script>
function countOfTryings(variable) {
$('a[name="toChallenge"]').each(function () {
var oldUrl = $(this).attr("href"); // Get current url
var str = oldUrl.substring(0, oldUrl.indexOf("parameter1"));
var newUrl = oldUrl.replace(oldUrl, str + "parameter1=" + variable.value); // Create new url
$(this).attr("href", newUrl); // Set …Run Code Online (Sandbox Code Playgroud)