Ryan
Ryan

Reputation:

Simple javascript variables question

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

Upvotes: 0

Views: 168

Answers (2)

Paolo Bergantino
Paolo Bergantino

Reputation: 488374

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.

Upvotes: 1

tribus
tribus

Reputation: 1110

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

be this

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

replacing the second ? with &

Upvotes: 5

Related Questions