【发布时间】:2013-01-21 04:44:47
【问题描述】:
我无法仅获取 href 的确切值。代码如下:
Link:
<a href="monthly"></a>
Script:
'a': function(target, process){
if(process == "stripe"){
document.location.href = "/accounts/stripe/payment"+target[0].href;
}else{
......
}
},
如果我运行它,输出将是:
http://localhost:8000/accounts/stripe/paymenthttp://localhost:8000/monthly/
请注意,本地主机正在复制。如何在没有本地主机的情况下仅获取 href 中的“每月”?我只尝试目标,但它是未定义的。我尝试了 target[1],但它不起作用。
【问题讨论】:
-
试试
target[0].pathname -
你能把你的答案贴出来让我投票吗
标签: jquery