Skip to content

Commit

Permalink
Live has been removed use on instead
Browse files Browse the repository at this point in the history
Live is removed in the next version of jQuery, use on instead which has
the same behaviour.

http://jquery.com/upgrade-guide/1.9/#live-removed
  • Loading branch information
edds committed Jul 13, 2015
1 parent 1cc8e5b commit 73e466e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions app/assets/javascripts/smart-answers.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ $(document).ready(function() {

// events
// get new questions on submit
$(formSelector).live('submit', function(event) {
$(formSelector).on('submit', function(event) {
$('input[type=submit]', this).attr('disabled', 'disabled');
var form = $(this);
var postData = form.serializeArray();
Expand All @@ -25,14 +25,14 @@ $(document).ready(function() {
});

// Track when a user clicks on 'Start again' link
$('.start-right').live('click', function() {
$('.start-right').on('click', function() {
GOVUK && GOVUK.analytics && GOVUK.analytics.trackEvent && GOVUK.analytics.trackEvent('MS_smart_answer', getCurrentPosition(), {label: 'Start again'});
reloadQuestions($(this).attr('href'));
return false;
});

// Track when a user clicks on a 'Change Answer' link
$('.link-right a').live('click', function() {
$('.link-right a').on('click', function() {
var href = $(this).attr('href');
GOVUK && GOVUK.analytics && GOVUK.analytics.trackEvent && GOVUK.analytics.trackEvent('MS_smart_answer', href, {label: 'Change Answer'});
reloadQuestions(href);
Expand Down

0 comments on commit 73e466e

Please sign in to comment.