Drewry is a user on social.tchncs.de. You can follow them or interact with them if you have an account anywhere in the fediverse. If you don't, you can sign up here.
Drewry @Drewry

problem here. I'm working on a string from a DOM object inside of an anonymous function that's called by .onreadystatechange. I can't seem to .split the string, because .split isn't able to be found. Is this something I can't call i anonymous functions? Do I need to do some sort of callback thing?

@Drewry I'd be surprised if you couldn't call split if it's a string.. If you make a new string inside the anon. function and call split() on it, does it work?

@hugomd good idea. I'll check it out. Working on a few projects at once probably isn't helping either >>

@hugomd OK you were right. Split works fine on a brand new string. So to get the variable I was trying to split, I stored the result of executing regular expressions on .childNodes[1].text of the original xml. Maybe it's still not storing as string even if it displays like one? I'm gonna try typeof.

@Drewry Yeah that makes sense — if you're still having trouble later just post the code ;)

@Drewry That doesn't make any sense. Usually when I encounter a problem like this it's because the thing I thought was a string is actually something else

@Kryten Yeah that's what I think is happening. I thought it was a string, but now I think I that I was wrong before and it's probably another thing.

@Kryten Yeah that's what I think is happening. I thought it was a string, but now I think I that I was wrong before and it's probably another thing.

@Drewry can you post the code of the function in question?

@GlenPierce Imma wait a minute, because I think I figured out that issue. :)

@Drewry Wierd, split is a method of the string prototype it should be there. Maybe what you have is not a string? Have you tried to console log it's typeof ? or it's prototype?

@sirgallifrey Yeah that was what it was. Typeof was useless, but I found toType on stack overflow and realized I was trying to split an array. I hadn't noticed that regular expressions return arrays and not strings. Lol