www.webdeveloper.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Nov 2004
    Location
    xxxyyy
    Posts
    355

    detect div content change

    Is it possible to detect DIV content change ?


    For example:
    I have a div ...

    <div id="mydiv">

    </div>


    Whenever a new content is loaded into this div I want to call a javascript function ...something like this ..



    <div id="mydiv" onload="myFunc()">

    </div>


    However this does not work.


    What is the correct way to do this ?

  2. #2
    Join Date
    Nov 2010
    Posts
    956
    no. divs (or more specifically their content) are not loaded, so they have no onload event. events like onchange apply to form elements. You are better calling myFunc as a result of the function that loads the content into your div

  3. #3
    Join Date
    Nov 2004
    Location
    xxxyyy
    Posts
    355
    Quote Originally Posted by xelawho View Post
    no. divs (or more specifically their content) are not loaded, so they have no onload event. events like onchange apply to form elements. You are better calling myFunc as a result of the function that loads the content into your div
    not understood. Can you please elaborate the BLUE part more

  4. #4
    Join Date
    Nov 2010
    Posts
    956
    something happens to load the content into your div, no? so when that happens, call myFunc

Thread Information

Users Browsing this Thread

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

Bookmarks

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