how can i fix this JavaScript with to document write on multiple location.href.indexOf
if (location.href.indexOf( "/smispage""/tpfpage""/client_images_new""/client_images_list" ) > -1) {
document.write( '<base target="_blank" />' );
}
It only seems to work on the smispage page regardless of how I lay out the list so:
"x","y" or "x";"y" or "x""y" or "x, y" or "x: y" or "x,y" or "x;y"
The
indexOfmethod simply doesn’t have that functionality: it lets you search for a single substring, and that’s it.One alternative is to use the
searchmethod, which lets you specify a regular expression. In your case, that could look like: