例如,我想转:https://google.com/A7239J成……https://example.com/google.com/A7239J我希望能够做到这一点,在浏览器中,使用Javascript。谢谢!
如果您打算使用该URL作为基础URL来获取资源,那么您可以使用<base>
元素:
<!-- every URL will be relative to this value -->
<base href="https://upload.wikimedia.org/wikipedia/commons/">
<img src="./4/47/PNG_transparency_demonstration_1.png" width=300>
<img src="./c/cf/Black_hole_-_Messier_87.jpg" width=300>