How do I get the exact href value just without their domain?
I am having trouble getting the exact value of the href alone. Here is the code:
Link:
<a href="monthly"></a>
Script:
'a': function(target, process){
if(process == "stripe"){
document.location.href = "/accounts/stripe/payment"+target[0].href;
}else{
......
}
},
If I run this output it will be:
http://localhost:8000/accounts/stripe/paymenthttp://localhost:8000/monthly/
Note that localhost is duplicate. How do I get only "monthly" in the href without that localhost? I'm trying to target only but undefined. I'm trying to use target [1], but it doesn't work.
+3
source to share
2 answers