[jQuery] Re: Simple Question: Using Variables in jQuery

2007-11-25 Thread Brett
The way you've described it, if you want to have the same name on two elements, you might be using a class instead of an id. instead of content try content - which will freely let you use it multiple times safely. On Nov 24, 4:07 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > On Nov 23, 4:

[jQuery] Re: Simple Question: Using Variables in jQuery

2007-11-24 Thread [EMAIL PROTECTED]
On Nov 23, 4:46 pm, yetanother <[EMAIL PROTECTED]> wrote: > $("ul#"myID).load("data.html"); > You need to use JavaScript string concatenation to build the selector: $("url#" + myID).load("data.html"); Also, you'll probably want to avoid assigning the same ID to two different elements. You're c

[jQuery] Re: Simple Question: Using Variables in jQuery

2007-11-24 Thread Wil Everts
Now I have it, I just needed to make them have unique id's and it worked. EX: if bob is the id, linkid = bob and the ulid = bobul) $(document).ready(function(){ $("a.bob").click(function() { var ID = $(this).attr("id"); $("#"+ID+"ul").load("data.html"); }); }); On 11/23/07, yetanother <[EMAI

[jQuery] Re: Simple Question: Using Variables in jQuery

2007-11-23 Thread RobG
On Nov 24, 7:46 am, yetanother <[EMAIL PROTECTED]> wrote: > I'm using an id tag (based on my database id) in my html to help > direct traffic. On a click I use the following which grabs the > variable from the id tag of the link: I presume you meant the id attribute of an A element. > > var my

[jQuery] Re: Simple Question: Using Variables in jQuery

2007-11-23 Thread Glen Lipka
Try $("ul#" + myID).load("data.html"); Hope this helps, Glen On Nov 23, 2007 1:46 PM, yetanother <[EMAIL PROTECTED]> wrote: > > I'm using an id tag (based on my database id) in my html to help > direct traffic. On a click I use the following which grabs the > variable from the id tag of the lin