On 31/01/07, Dmitry Rudakov <[EMAIL PROTECTED]> wrote:
>
> 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
> --

You are passing it as an array (with a single object). Try removing [ and ]
_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/

Reply via email to