Remove forward slash from URL jquery -
I am trying to delete "/" before the following code
if ($ (This) .fund ('img'). Length) {var url = New URL ($ (this) .find ('img'). Et ('scom')); $ ("# Ajaximageid") val (url.pathname). }
I have tried to use
url.replace ("/", "") but I get an error
Any help would be appreciated I have tested the url object and found that you can not delete < Div class = "post-text" itemprop = "text" / i
.
If you do url.pathname = 'test', then
, the path is named / test
.
What you can do when you use it, you cut the first letter:
$ ("#jjaximageid"). Val (url.pathname.slice (1));
Comments
Post a Comment