簡體   English   中英

用JavaScript更新URL不起作用

[英]Update URL with JavaScript doesn't work

我正在嘗試使用另一個標簽來更改某些標簽的網址。 無法正常工作。 請幫忙。

這是我的代碼:

<a href="#" rel="wd" onclick="updateUrl('wd')">Category</a>

<a id="test" href="index.php?path=portfolio/web" class="thumbnail"><img src="img.jpg"></a>

<script type="text/javascript">
function updateUrl(newUrl)
{
    document.links["test"].href .= newUrl;
}
</script>
document.links['test'].href += newUrl;

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM