String.split not working

Hi, I have a working xul extension. But when I try to do a split on the target it stops working.

var target = event.originalTarget;
window.alert(target); //works
var site = target.split("?");
window.alert(site[0]); //does not work

Should I try it a different way?

target is not a string, and thus you can’t just split it, most likely.

I also tried target.tostring().split("?") with the same results.

Sorry, I got it. I forgot to capitalize the “S” in toString(). Works now. Thanks.