How do I programmatically know the jQuery version using a script or a hook? How do I programmatically know the jQuery version using a script or a hook?

I have used this script for getting the site's jQuery version.

if (typeof jQuery != 'undefined') {  
// jQuery is loaded =&gt; print the version
alert(jQuery.fn.jquery);


How could i get the same by using some database query or hook programmatically?
you can use this code to get all installed modules list

module_load_include('inc', 'update', 'update.report');
$available = update_get_available(TRUE);
$data = update_calculate_project_data($available);
dpm($data);  // provides installed modules details as an array
dpm($data['jquery_update']['existing_version']); // provides jquery_update module existing version