Skip to content Skip to sidebar Skip to footer

Jquery "modify" Event

So I recently took a closer look at JavaScript and jQuery and after that stumbled over the Firefox extension called Greasemonkey. Well, let me explain what I mean with the 'modifiy

Solution 1:

var orig;

$(function(){
     orig = getContent();
})

functionwatchContent() {
     var mod = getContent();
     if (mod != orig){ resetContent(orig); }
     setTimeout(watchContent,1000)
}

functionresetContent(html) {
  $("body").append( html );
}

functiongetContent() {
    return $("body").html();
}

Solution 2:

With jQuery events if you want the event to apply to new elements you would use the .live method, however jQuery 1.3 doesn't support blur, focus, mouseenter, mouseleave, change, or submit events as live events, and it's change that you will want to use. (change, submit, and blur/focus are on the roadmap for jQuery 1.4)

As an alternative you could use the liveQuery plugin.

Post a Comment for "Jquery "modify" Event"