Skip to content
This repository has been archived by the owner on Apr 21, 2019. It is now read-only.

Incompatible with newer jQuery Versions #5

Open
arueckauer opened this issue Jun 13, 2013 · 2 comments
Open

Incompatible with newer jQuery Versions #5

arueckauer opened this issue Jun 13, 2013 · 2 comments

Comments

@arueckauer
Copy link

Error message

With newer versions of jQuery and jQuery UI the following error occurs whenever destroyDialog() is triggered:

Uncaught Error: cannot call methods on dialog prior to initialization; attempted to call method 'close'

Test code

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8" />
    <title>Timeout Dialog</title>
    <script src="http://code.jquery.com/jquery-1.10.0.min.js"></script>
    <script src="http://code.jquery.com/ui/1.10.3/jquery-ui.min.js"></script>
    <script type="text/javascript" src="js/timeout-dialog.js"></script>
    <link rel="stylesheet" href="css/index.css" type="text/css" media="screen, projection" />
    <link rel="stylesheet" href="css/timeout-dialog.css" type="text/css" media="screen, projection" />
</head>
<body>
  <div>
    <a href="#" id="timeout-example">Click Here to See Demo</a>
  </div>
<script type="text/javascript">
/*<![CDATA[*/
$(function () {
 $("#timeout-example").click(function(e) {
   e.preventDefault();
   $.timeoutDialog({timeout: 1, countdown: 60, logout_redirect_url: 'https://github.com/rigoneri/timeout-dialog.js', restart_on_yes: false});
 });
});
/*]]>*/
</script>
</body>
</html>
@JMooreWeb
Copy link

This was the highest combination of jQuery and jQuery UI I could get this to function properly.

https://ajax.googleapis.com/ajax/libs/jquery/1.7.0/jquery.min.js
https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.24/jquery-ui.min.js

@eogiles
Copy link

eogiles commented Jul 30, 2014

This appears to be fixed by pull request 8 though it hasn't been accepted yet:
#8
Basically you need to change the line in the destroyDialog function
from
$(this).dialog("close");
to
$("#timeout-dialog").dialog("close");

Works for me in 1.11.0

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants