This article describes the method of encode encoding of url URLs by JavaScript. Share it for your reference. The specific analysis is as follows:
JavaScript encodes the URL URL and uses encodeURIComponent
var myUrl = 'http://www.baidu.com';var myOtherUrl = "//www.VeVB.COM/index.html?url="+encodeURIComponent(myUrl);
I hope this article will be helpful to everyone's JavaScript programming.