0
我想改变以下网址:JS字符串格式化
`http://en.savefrom.net/#url=https://www.youtube.com/watch?v=xxxxxx`
到
`http://www.website.my/p/test.html?id=https://www.youtube.com/watch?v=xxxxxx`
是否有一个JavaScript或jQuery的解决方案呢?
我想改变以下网址:JS字符串格式化
`http://en.savefrom.net/#url=https://www.youtube.com/watch?v=xxxxxx`
到
`http://www.website.my/p/test.html?id=https://www.youtube.com/watch?v=xxxxxx`
是否有一个JavaScript或jQuery的解决方案呢?
如果它永远是这些确切的模式,你可以这样写:
var newUrl = 'http://www.website.my/p/test.html?id=' +
oldUrl.split('#url=')[1];
这里的Fiddle。
如何申请?你可以在jsfiddle.net – Mansyur
(https://jsfiddle.net/rikojeff/1541872p/) – Mansyur