mockko / livereload

LiveReload applies CSS/JS changes to Safari or Chrome w/o reloading the page (and autoreloads the page when HTML changes)
http://livereload.com/
1.18k stars 56 forks source link

JavaScript events is not refreshed after a live reload #31

Closed rizkysyazuli closed 13 years ago

rizkysyazuli commented 13 years ago

it seems javascript events are not refreshed after a live reload.. old events are still trigered.. i'm using jquery 1.4 doing a simple toggle function on Safari 5.0.2 (OSX 10.6.4).

$('.help').toggle(
    function(e) {
      // do stuff

      e.preventDefault();
    },
    function(e) {
      // do stuff

      e.preventDefault();
    }
  );
};
NV commented 13 years ago

LiveReload can't rebound events properly. After reload you'll have both old and new events.

You could add config.apply_js_live = false into your .livereload file. It'll reload the whole page when changes in JS files are made.

Have no idea why config.apply_js_live turned on by default. Most scripts doesn't work well with it.

rizkysyazuli commented 13 years ago

thx.. will do that. but it wont be as cool as doing a real live reload tho :P