Trying to figure out a way to use Javascript to set up a little if-else statement using only part of the url to determine if it should go somewhere or not. So far what I got is,
<script>
if (url==example.com) {
window.open('1stoption','1stoption');
} else {
window.open('2ndoption','2ndoption');
}
The problems so far are that it doesnt count if its exampample.com/whatever or anything like that.
Thanks for any help.
*edit Thanks guys it worked but I worded my question wrong, it should be more along the lines of showing a link but having the link go to two separate pages depending on the url. This stuff works and I’m kicking it around to get it to work my way too. Thanks alot.
maybe this is what you want?
This will open window
first optionif it findsexample.comanywhere within the url