[jQuery] Re: How to handle dynamic clicks?

2009-09-29 Thread lionel28
Nice! Thank you. I have one last issue. I am using tinymce for all the textareas. When I click on the edit link, that displays and allows me to do the ajax edit and on submit displays the change. Unfortunately, since the tinymce was already loaded when the page was first loaded, if I click on

[jQuery] Re: How to handle dynamic clicks?

2009-09-29 Thread James
You could group it together to shorten it. Makes it nicer (for me, at least) and less variables. :) var cid = this.id.split('_')[1]; On Sep 28, 9:26 pm, lionel28 wrote: > Hi Charlie. > > In a page I have a lot of entries and I am onclick do an edit. So each one > must have a unique id. > the

[jQuery] Re: How to handle dynamic clicks?

2009-09-29 Thread lionel28
Hi Charlie. In a page I have a lot of entries and I am onclick do an edit. So each one must have a unique id. the split allows me to get the id $(document).ready(function() { $('a[id^=doedit_x]').live('click', function(event) { var fullid = this.id; var split = fullid.split("_"); va

[jQuery] Re: How to handle dynamic clicks?

2009-09-28 Thread Charlie Griefer
Incidentally... not sure why you'd need to use split() for your needs there? Could you post some code or explain what your requirement is? You may be going about it the long way (or I may be misunderstanding what you're trying to do) :) On Mon, Sep 28, 2009 at 12:42 PM, Charlie Griefer wrote:

[jQuery] Re: How to handle dynamic clicks?

2009-09-28 Thread Charlie Griefer
Hi Lionel: I've not bought a JavaScript book in ages. But the one that I learned from a while back is the JavaScript Bible by Danny Goodman. A quick Amazon search shows that a 7th Edition is in pre-release status (glad to hear) :) If you want a jQuery book, there are a couple of ways to go. Th

[jQuery] Re: How to handle dynamic clicks?

2009-09-28 Thread lionel28
Charlie, Thank you very much. I was able to do a split so I get actual value from your code and all is fine. I do whatever I want with php, but could you recommend a book for Javascript. Example: for the split I had to do a Google search :thinking: A book with all those easy code like yours,

[jQuery] Re: How to handle dynamic clicks?

2009-09-28 Thread Charlie Griefer
You shouldn't need to use a named function, or an inline onclick. If you can move that id attribute into the tag itself, you could do: ... and then your jQuery would be: $(document).ready(function() { $('a[id^=doedit_]').click(function() { alert(this.id); <-- shows that you h