我有代码巫婆获得短号网址 在网址中我想添加foloder /我得到link = hostname / folder / pathname
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<a id="Link" href="#">open link</a>
<script>
$(document).ready(function(){
var newURL = window.location.hostname + "folder/" + window.location.pathname;
$("#Link").attr("href", newURL);
});
</script>
此代码但无效