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, but what the api generates is youtube.com/watch?v=3sZOD3xKL0Y&feature=youtube_gdata. So what I need to do is be able to select everything after and including the ampersand and remove it from the url. Any way to do this with javascript and some sort of regular expression?
Take the 2-minute tour
×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.
|
Simple:
Modified: this will remove all parameters or fragments from url
|
|||||
|
Example: http://jsfiddle.net/SjrqF/
or: Example: http://jsfiddle.net/SjrqF/1/
|
|||
|
You could use a RegEx to match the value of
|
|||
|
Hmm... Looking for better way... here it is
|
|||
|