Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7713861
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T01:58:44+00:00 2026-06-01T01:58:44+00:00

I am creating a script in JS that will be called from external sites,

  • 0

I am creating a script in JS that will be called from external sites, but my code requires Jquery to work, specially 1.7 and 1.8 for UI, I found a way to check if jquery is installed and get the version:

$().jquery

But this will give me back a string with dots (1.6.1); is there already a function to check if the version installed is older than the one that I required?

I also need the same for the UI library, i found this but I am not very sure if it works properly, or maybe I don’t know how o use it:

//Get version:
$.ui.version
//Comnpare version
var version_required = 1.7.1
version = $.ui ? $.ui.version || "pre "+version_required : 'not found';

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T01:58:45+00:00Added an answer on June 1, 2026 at 1:58 am

    This might work for you:

    if (typeof jQuery != 'undefined' && /[1-9]\.[7-9].[1-9]/.test($.fn.jquery)) {
        // jQuery is loaded and is at least version 1.7.1
    }
    

    Likewise, it’s almost the same for the UI:

    if (typeof jQuery.ui != 'undefined' && /[1-9]\.[7-9].[1-9]/.test($.ui.version)) {
        // jQuery UI is loaded and is at least version 1.7.1
    }
    

    First it checks to make sure jQuery is available and then it uses some simple regex pattern to test that the version numbers are within an acceptable range.

    UPDATE: This will also work with jQuery 2 and 3.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am creating a php backup script that will dump everything from a database
I am creating a price comparison script that will work with XML feeds, given
I'm creating a script that will take users location from their ip. I saw
I'm creating a bash script that will load CSV files using SQL*Loader. Please refer
I am creating a quick backup script that will dump some databases into a
I'm creating a jquery plugin and I want to verify an external script is
I'm creating script that will add , at every unordered list's list element with
I am creating a script that will show your computer information in Non-Geekeese. This
I am creating a script that will be run in a MS SQL server.
I'm creating a script that will read a csv file and display it on

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.