Possible Duplicate:
javascript - check if string begins with something?
I've read in this post that you can use ^= to check if a string begins with something.
I've fiddled with this example:
var foo = "something-something";
if(foo ^= "something") {
alert("works!");
}
else{
alert("doesn't work :(");
}
And it doesn't work - does anyone how to do this?
jsfiddle example here: http://jsfiddle.net/timkl/M6dEM/