tags:

views:

87

answers:

3

Can anybody tell me why this line isn't working?

window.open('entertainers/drilldown.php?state=' + varlocation + '?p=','performers_frame')

I know it's simple, and I know iframes suck but i am not familiar with javascript variables.

Thanks in advance!

Ryan

+1  A: 

There's nothing jQuery about that variable. If that's a jQuery wrapped set you'd need to show us the rest of the code or tell us what it represents so you can get the attribute you're looking for. You're not providing enough for us to help you.

EDIT:

Ryan, if the variable is defined as $.varlocation then you have to append it as that. Try this:

window.open('entertainers/drilldown.php?state=' + $.varlocation + '&p=','performers_frame')

Just because it is declared with a $ doesn't mean it is a jQuery wrapped set. In this case, it isn't.

Paolo Bergantino
There's a comment section created purposly for these kind of statements, right under the question.
Luca Matteis
@Luca: Really? That's how the site works? Wow. Thanks.
Paolo Bergantino
i swear i tried that, but i mustnt have. worked perfect. thanks
@Paolo, as bitingly funny as that sarcasm was, someone with close to 30k rep, such as yourself, should know that your original answer *wasn't* an answer at all, hence should have been in a comment. That's something Luca seems to have learned much quicker than you :-).
paxdiablo
@Pax: I am willing to concede that the original answer was tiptoeing the line between a comment and an answer. I obviously know where things belong and if I posted it as an answer it's because it was my answer. He downvoted it, I added to it, it helped the OP, everyone's happy.
Paolo Bergantino
+5  A: 

should this drilldown.php?state=' + varlocation + '?p=','performers_frame')

be this

drilldown.php?state=' + varlocation + '&p=','performers_frame')

replacing the second ? with &

tribus
A: 

Paolo Bergantino: you are correct, it is wrapped in a jQuery set, i should have posted more of the code.

tribus: yeah definatly. but thats not why its not working.

varlocation is just defined as a string, performed like this:

$.varlocation = "vic";

I can perform window.open function without the variable, but when i chuck the variable in there, the window.open doesnt work. So i am assuming i am either defining the variable wrong, or inserting it wrong..

$.varlocation !== varlocation
seanmonstar