gpt4 book ai didi

javascript - JS 字符串格式

转载 作者:行者123 更新时间:2023-12-02 14:17:37 25 4
gpt4 key购买 nike

我想更改以下网址:

`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 .

关于javascript - JS 字符串格式,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38903310/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com