how can I remove this URL section from this string (representing the URL) using old JavaScript?

后端 未结 4 939
清酒与你
清酒与你 2021-01-29 12:32

I am not so into JavaScript and I have the following problem.

I have a string like this:

https://smart.XXX.it/default.asp/s4

into a var

4条回答
  •  感动是毒
    2021-01-29 12:58

    You could .split() the url like such:

    let url = 'https://smart.XXX.it/default.asp/s4'.split('/default.asp/').join('/');
    console.log(url);

提交回复
热议问题