how to convert https to http using java script in html page [closed]

I think you should try first, but let me give some snippet code to give idea.

You need to use replace().

I am giving you about two cases, this is just to make understanding.

If you want to convert the current url, then you should use “window.location.href” to take current url,

window.location = window.location.href.replace(/^https:/, 'http:');

And when you want to convert of any specific url then

var custom_url = "put your url here"
window.location = custom_url.replace(/^https:/, 'http:');

Leave a Comment