Basically, if I'm at: http://example.com/content/connect/152, I want to find out if "connect" is present in the url and then set the selected value of a menu to something specific... (The url could also be something like http://example.com/content/connections, in which case, it should still match...)
This is what I've been trying, which, clearly isn't working....
var path = window.location.pathname;
if(path).match(/^connect) {
$("#myselect").val('9');
} else {
$("#myselect").val('0');
}