Word replacing javascript for one specific browser -
i need javascript going replace 1 word if page being displayed browser.
for word replacement came code:
window.onload = clear; function clear() { document.body.innerhtml = document.body.innerhtml.replace(/replaceitemid/g, 'title');
and it's working great want loaded if navigator.useragent
or navigator.appversion = ingamebrowser
. i'm looking simplest solution, nothing fancy.
i did it! post working version if ever going similar thing
browsername=navigator.appversion; if (browsername.indexof("ingamebrowser")!=-1) {browsername="ai"}; if (browsername=="ai") {window.onload = clear; function clear() { document.body.innerhtml = document.body.innerhtml.replace(/replaceitemid/g, 'title');} };
check out bowser: https://github.com/ded/bowser
example:
if (bowser.msie && bowser.version <= 6) { alert('hello china'); }
Comments
Post a Comment