remove url parameters with javascript or jquery

前端 未结 10 2419
臣服心动
臣服心动 2020-12-25 10:15

I am trying to use the youtube data api to generate a video playlist.

However, the video urls require a format of:

youtube.com/watch?v=3sZOD3xKL0Y
<         


        
10条回答
  •  伪装坚强ぢ
    2020-12-25 10:47

    Hmm... Looking for better way... here it is

    var onlyUrl = window.location.href.replace(window.location.search,'');
    

提交回复
热议问题