Skip to main content
WolfShade
Legend
August 27, 2020
Answered

jquery.reveal.js: uses jQuery.live(), which no longer exists

  • August 27, 2020
  • 1 reply
  • 586 views

Hello, all,

 

I am tasked with upgrading old versions of jQuery to v3.5.1.  I've had some success, but my next attempt has me a bit baffled, so I'm here to ask for ideas.

 

One sub-section of this project, the developer (no longer here) used something called jquery.reveal.js.  It is attempting to make a call to a .live() function that has been deprecated.  Now, I've read online where .live() can be replaced with .on(), but due to .on() having different arguments, you can't just swap it out without some modification.  Well, none of the developer code contains .live() that I've found (so far); but the jquery.reveal.js file does.  I'm leery about editing the library file - I believe bad things can happen when one goes about tinkering with someone else's baby.

 

So, what do you guys think should be my next step?  Looking at the Reveal site, Reveal hasn't been updated since 2011, so there's no route, there.

 

V/r,

 

^ _ ^

This topic has been closed for replies.
Correct answer WolfShade

No replies, so I went ahead and did what I didn't want to do.  I edited the jquery.reveal.js file.  Just changed the only .live() tag in the document from:

$('a[data-reveal-id]').live('click', function(e) {

To:

$('[data-reveal-id]').on('click', 'a', function(e) {

I loaded the page, and did not get any error messages.  Still have anxieties, though.  Keeping my fingers crossed that, somewhere down the road, this doesn't come back to bite me in the undercarriage.

 

V/r,

 

^ _ ^

1 reply

WolfShade
WolfShadeAuthorCorrect answer
Legend
August 28, 2020

No replies, so I went ahead and did what I didn't want to do.  I edited the jquery.reveal.js file.  Just changed the only .live() tag in the document from:

$('a[data-reveal-id]').live('click', function(e) {

To:

$('[data-reveal-id]').on('click', 'a', function(e) {

I loaded the page, and did not get any error messages.  Still have anxieties, though.  Keeping my fingers crossed that, somewhere down the road, this doesn't come back to bite me in the undercarriage.

 

V/r,

 

^ _ ^