I'm making a bookmarklet that has different variables stored in the switch cases that I want to call depending on what webpage the bookmarklet is used on.
case "http://page1.html": a=1;b=2;c=3;break;
case "http://page2.html": a=3;b=2;a=1;break:
default: alert("window.location= "+page+"");
This isn't my exact code I tested the bookmarklet without the switch in it and it worked perfectly but when I tried to use the switch all i get is the alert that tells me the page url. I set the default to alert to tell me the page url to see if I put the wrong url in for the case but that wasn't the problem.
Am I just using switch wrong or did I mess up in the coding?