Hmmm... That would work perfectly. I'll take a look at it. Thanks.
On Apr 22, 4:55 pm, "Jake McGraw" <[EMAIL PROTECTED]> wrote:
> The default behavior:
>
> $(".classname").click(function(){
> alert("Hello, world!");
>
> });
>
> $("body").append('<span class="classname">Click Me!</span>');
>
> Clicking "Click Me!" would do nothing.
>
> Using the liveQuery plugin (http://brandonaaron.net/docs/livequery/):
>
> $(".classname").livequery("click", function(event) {
> alert("Hello, world!");
>
> });
>
> $("body").append('<span class="classname">Click Me!</span>');
>
> Clicking "Click Me!" should now produce an alert window.
>
> - jake
>
> On Tue, Apr 22, 2008 at 4:45 PM, Brian Ronk <[EMAIL PROTECTED]> wrote:
>
> > I have a click even that I add to a certain class when the page is
> > created. There is the possibility of dynamically adding another
> > element with that class, and I would like to have the same click even
> > added. I'm just wondering what would happen if I registered the click
> > event for that class, would that work? For instance:
>
> > At page creation, this is run:
> > $('.classname').click(function() {
> > ...
> > });
>
> > If I ran this after a new element with that class was created, would
> > that screw anything up. I do have an id associated with the element,
> > so I could just add the event that way. I just wasn't sure if there
> > might be a better way, or if I could add that to a function, and just
> > call it when needed.