Re: [jQuery] Jquery and Dynamic assignment

2010-01-21 Thread Nathan Klatt
On Wed, Jan 20, 2010 at 2:54 AM, West415 malik.robin...@gmail.com wrote:
 My question is how can I use jquery to assign click handlers without having
 to do this:

 cfloop from=1 to=5 index=i
 button id=create-user_#i# click=createUser(#user_id#)Create
 User/button
 button id=create-user_#i# click=createUser(#user_id#)Create
 User/button
 /cfloop

Should be able to make something like this work:

$(button.createUserLink).click(function() {
  createUser(this.id);
});

Nathan


[jQuery] Jquery and Dynamic assignment

2010-01-20 Thread West415

Hi,

I am new to jquery and I have some code that I wrote that loops over some
records from my database and at each iteration of the loop (a coldfusion
loop, either way same concept) I want to create a few buttons that the user
can click to do things.  Each button will be unique by appending a counter
to it equal to the current row in my loop like so:


Create User
Edit User


My question is how can I use jquery to assign click handlers without having
to do this:


Create User
Create User

-- 
View this message in context: 
http://old.nabble.com/Jquery-and-Dynamic-assignment-tp27238454s27240p27238454.html
Sent from the jQuery General Discussion mailing list archive at Nabble.com.