Hi sure, Based on the example code, a single button that creates a new dialog on every click, there is absolutely no reason to use .live() instead of .click(). The event delegation that .live() provides is not necessary, or even helpful, in all situations.
On Mar 22, 2:03 am, p suresh <[email protected]> wrote: > Hi, > Use live method() instead of click method. I think it is the > permanent solution for this. live fires for new added content also. > Read documentation about live() method at jquery site. And one more > suggestion is user .class selectors instead of id. It saves lot of > redo work. > > $(".class").live("clink",function() > { > as as usuall your codes come here > > }); > > Note: live() method works for jquery 1.3 + versions. > > Regards > sure > On 3/21/09, Loony2nz <loony...@g > > mail.com> wrote: > > > Added a click function to an anchor tag <a href="" > > id="newDialog">click here</a> > > I am creating a div and adding content to the div and appending it to > > the body. > > Then I want to open a dialog box with the content I've created > > dynamically. > > > Check the code below: > > > $('#newDialog').click(function(e) { > > > $('<p id="newDialogText"></p>') > > .html('Some HTML Text') > > .css('display', 'none') > > .appendTo("body"); > > > $("#newDialogText").dialog("open"); > > return false; > > > }); > > > In checking the generated HTML, the DIV is created. However, the > > dialog doesn't open it. > > > Any help is appreciated. > > > Thanks! --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "jQuery UI" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/jquery-ui?hl=en -~----------~----~----~----~------~----~------~--~---
