xui/xui — Issue #55: Using a variable as a selector doesn't work
Author: mazito
Created: 2011-10-10 16:44:42+00:00
State: open

I don´t know if this is a bug, or if it is intended to work like this.
If I get a selector from an element attribute (the attribute contains the selector) and put it into a variable, using this variable as a selector does not work:

Example:

var ref= x$("#somepage").attr("href") ; // variable 'ref' contains "#idselector"
x$(ref).css("display", "block") ; // this does NOT work

But if I do:

x$(""+ref).css("display", "block") ; // enforcing a string conversion, THIS works

BTW: xui is awesome. I have been using jQuery for many years but it's a little heavy for mobile.
Tested xui and its so light and compact ! Keep the good work !