String.split not working

(Mpoznecki) #1

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?

(Martin Giger) #2

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

(Mpoznecki) #3

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

(Mpoznecki) #4

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