www.webdeveloper.com
Results 1 to 2 of 2

Thread: Live on created div

  1. #1
    Join Date
    Dec 2004
    Location
    The Netherlands
    Posts
    97

    Live on created div

    I'm trying to trigger an event on a dynamically created div using the .live() function of Jquery.

    The problem probably is that the Javascript code is loaded (and run) long before the div is created.
    The div is only created AFTER a user action which triggers an AJAX call. The return from the PHP script contains the div on which the .live() should react.

    How should I do this?

    The ultimate goal is to make this div editable using jeditable.

  2. #2
    Join Date
    Dec 2004
    Location
    The Netherlands
    Posts
    97

    Post

    To clarify, this is my javascript code for the .live() function.
    name_column is the name of the div.
    The code is not showing any results (alert is not shown, live event is not triggered).

    Code:
    <script type='text/javascript'>
    $("name_column").live('mouseover', function(){
     alert ('entering');
    });
    </script>

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles