if(window.location.search.search(/^\?id=(1|2)/)) { } else { }
if(/^\?id=(1|2)/.test(window.location.search)) { } else { }