我在JQuery方面很新颖!我知道如何从后续更改按钮来取消关注点击时,但我需要的URL(在按钮)打电话给我ResponseEntity在春天,我不知道该怎么办呢....如何在JQuery中动态更改URL
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title></title>
<style type="text/css">
button {
padding: 5px 10px;
font-size: 14px;
}
</style>
<script type="text/javascript" src="http://code.jquery.com/jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$("button").click(function(){
$(this).text($(this).text() == 'Follow' ? 'Unfollow' : 'Follow');
$('a').attr('href',($(this).text() == 'Follow' ? 'FollowUrl' : 'UnFollowUrl');
});
});
</script>
</head>
<body>
<button type="button">Follow</button><a href="/firsttime" id="url">Follow</a>
<p><strong>Note:</strong> HINT: Click the button to swap the text and the URL.</p>
</body>
</html>
你是什么意思的“点击按钮交换文本和URL”?什么网址? – Zorken17