1

I have a problem with jQuery UI Dialog - it is not closing when I click the X button.

I have detected that the problem goes away if I change the order of my javascript includes:

If I include files in the following order then the problem appears:

<script src="../../Scripts/jquery-1.6.4.min.js" type="text/javascript"></script>
<script src="../../Scripts/jquery-ui-1.8.7.min.js" type="text/javascript"></script>
<script src="../../Scripts/jquery.validate.min.js" type="text/javascript"></script>

If I include files in the following order then the problem disappears:

<script src="../../Scripts/jquery.validate.min.js" type="text/javascript"></script>
<script src="../../Scripts/jquery-1.6.4.min.js" type="text/javascript"></script>
<script src="../../Scripts/jquery-ui-1.8.7.min.js" type="text/javascript"></script>

This seems really strange - I thought that you should include the core jQuery stuff right at the top of the file? Presumably jquery.validate.min.js has dependencies upon the core jquery libs.

But, this issue would suggest that jquery.validate.min.js has some sort of conflict with the core?

Anyone know the best way of dealing with this?

Apologies that this may appear to be a dupe of jQuery UI Dialog will not close - I wanted to raise a new issue as it seems to be a slightly different problem to the one I originally raised.

Thanks very much.

Community
  • 1
  • 1
Journeyman
  • 10,011
  • 16
  • 81
  • 129
  • 2
    Probably jQuery.validate is not being run at all. Does your code that uses jQuery.validate functionality still work? It is probably a conflict between jQuery.validate and jQueryUI. – gilly3 Sep 30 '11 at 17:54
  • Does including jquery.validate.min.js before the jQuery core produce any javascript errors? – jtfairbank Sep 30 '11 at 17:54
  • Is jQuery running at all? Type `$` into the console. You should get `function (a,b){return new d.fn.init(a,b,g)}` – Michael Jasper Sep 30 '11 at 17:55
  • jQuery is definitely running. Yes - placing validate before the core does produce a "jQuery is not defined" error. What is the best way to escalate this problem? – Journeyman Sep 30 '11 at 18:06
  • what version of jQuery validate are you using? the older versions wont work with jquery 1.5+ – Kevin B Sep 30 '11 at 18:28
  • you need to be using jQuery Validate 1.8.1 with any version of jQuery newer than 1.5 – Kevin B Oct 01 '11 at 19:45
  • @Journeyman, although the browsers decides the order of script loads; I get "jQuery is not defined" when I move the script tag for jQuery-validation above jQuery. How did you get by that issue? – Umair Ishaq Oct 09 '13 at 19:20

0 Answers0