var language=[]; if(window.location.pathname.indexOf('showvideo.php')>-1){ showvideo=[3,66,68,67,69,70,71,72,73,5,6,7,165,214]; for (let i = 0; i < showvideo.length; i++) { try{ document.body.innerHTML = document.body.innerHTML.replace(new RegExp(language[showvideo[i]].split('=>')[0],'g'),language[showvideo[i]].split('=>')[1]); }catch(e){ console.log(e); } } }else{ for (let i = 0; i < language.length; i++) { try{ document.body.innerHTML = document.body.innerHTML.replace(new RegExp(language[i].split('=>')[0],'g'),language[i].split('=>')[1]); }catch(e){ console.log(e); } } }