I'm just getting started with JQuery.
When I tried to implement a small function I encountered the following:

there is contruction in my HTML
<li><span id="navline_next">next</span></li>


а)

function StateHandler(is_next) {
 
   var span_id=[is_next ? "#navline_next" : "#navline_prev"];

   if(jQuery(span_id).parent().is("li")) {

**** always false 

b)

function StateHandler(span_id) {
 
   if(jQuery(span_id).parent().is("li")) {

**** true if I call this function as  StateHandler("#navline_next")

What's wrong with variant b? Can I use VAR as parameter for JQuery?

Could you help me with this issue? Maybe it's not connected with JQuery, but
JavaScript syntax?

Thanks,
Dmitry
-- 
View this message in context: 
http://www.nabble.com/string-as-var-in-JQuery-tf3148441.html#a8728047
Sent from the JQuery mailing list archive at Nabble.com.


_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/

Reply via email to