-1

Example:

If jQuery-UI is v1.8.4 and I run this script:

var jqVersion = $.ui.version;
if (jqVersion < 1.9.0) {
    console.log("You currently have v" + jqVersion + ". Upgrade it");
}

So obviously this doesn't work.

Here's a fiddle: http://jsfiddle.net/mA9b6/

I just need to trigger the console warning if it's less than version 1.9

user1447679
  • 3,076
  • 7
  • 32
  • 69

1 Answers1

-1

You need to put quotes around the version you are testing for. The following resolves corretly:

var jqVersion = $.ui.version;

if (jqVersion < '1.9.0') {
    console.log("You currently have v" + jqVersion + ". Upgrade it");
}
ron tornambe
  • 10,452
  • 7
  • 33
  • 60