Skip to content

Instantly share code, notes, and snippets.

@priyankmaniar
Created September 27, 2018 20:21
Show Gist options
  • Select an option

  • Save priyankmaniar/c0301651a3f271593543863f73f0ba4c to your computer and use it in GitHub Desktop.

Select an option

Save priyankmaniar/c0301651a3f271593543863f73f0ba4c to your computer and use it in GitHub Desktop.
Javascript change image source to http.
var myVar = setInterval(httpOnlyMaker, 3000);
/** Supply filename only in the imgElement. Full path is not required.
*/
function httpOnlyMaker() {
var imgElement = jQuery("img[src$='LXH_Zinanshan.5ba65047732b8.jpg']");
if(imgElement.length >= 1){
imgElement.attr('src', imgElement.attr('src').replace('https', 'http'));
clearInterval(myVar);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment