I want to convert the current url to https version with javascript. How can i do this?
Example: http://www.abc.com → https://www.abc.com
window.location = window.location.href.replace(/^http:/, 'https:');
If you know that your http url starts with "http: //", then it is as simple as:
var httpsUrl = "https" + httpUrl.substring(4);
Source: https://habr.com/ru/post/1775102/More articles:Optional market forecasting software platform, Hubdub.com clone, etc. - open-sourceSeam with JSF vs Seam with GWT - javaOSError: [Errno 24] Too many open Google App Engine task queue files in Dev - google-app-engineFancy link notation? - phpHow to pass ViewModel data between POST requests in ASP.NET MVC? - c #Should I use a listener interface or handler for event callbacks in Android development? - javaHow to determine which column was clicked in a table using tablesorter? - jqueryHow to get ExtJS ComboBox to display inline text? - cssC # Detect Key Press, don't use enter keys - c #What does Firefox add to XULRunner? - firefoxAll Articles