Drupal Remove jQuery, and jQuery UI and add migrate plugin with Updated jQuery and UI I am trying to use drupal_add_html_head to add script elements to the head tag, however, this is important that these script tags are not self-closing because that is not the correct way to add them.

How do I do this:

$html5jquerymigrate = array(
    '#tag' =&gt; 'script',
    '#attributes' =&gt; array(
        'src' =&gt; libraries_get_path('jquery.migrate', true) . '/jquery-migrate-1.2.1.min.js',
    ),
    '#prefix' =&gt; '',
    '#suffix' =&gt; '',
);

drupal_add_html_head($html5jquerymigrate, 'html5jquerymigrate');


But instead of getting it printed out like this:  &lt;script src="/sites/all/libraries/jquery.migrate/jquery-migrate-1.2.1.min.js" /&gt;

How do I have it print out in the head like the following instead?

&lt;script src="/sites/all/libraries/jquery.migrate/jquery-migrate-1.2.1.min.js"&gt;&lt;/script&gt;
Ok, there was no 1 step solution to this problem.  So here's what I did in case anyone else wants to know.

This is a 3 STEP solution to adding jQuery 1.9 and jQuery UI 1.10 functionality to Drupal 7.  Not sure about other versions of Drupal.

1 - Needed to remove Drupals old jQuery library of version 1.4 and replace with version 1.9, so in my theme, I added the following function:

In template.php

function MYTHEME_js_alter(&amp;$js) {

    $js['misc/jquery.js']['data'] = 'http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js';

    // Adding this ensures that the UI functionality gets added at all times!  Even when logged out of the site, since we have functionality on the site that requires this when logged out!
    if (!isset($js['misc/ui/jquery.ui.core.min.js']))
    {
        drupal_add_js('http://ajax.googleapis.com/ajax/libs/jqueryui/1.10.3/jquery-ui.min.js');
    }
    else
        $js['misc/ui/jquery.ui.core.min.js']['data'] = 'http://ajax.googleapis.com/ajax/libs/jqueryui/1.10.3/jquery-ui.min.js';
}


2 - Now that this is done, before we can really take advantage of Drupal with any other jquery library that is greater than 1.8 (which sucks), we need to add in the migrate plugin found here:  http://blog.jquery.com/2013/05/08/jquery-migrate-1-2-1-released/

I have the Libraries Module installed, so I just put the JS in my Libraries folder called: jquery.migrate

3 - Than I added this to template.php file for my theme:

function MYTHEME_page_alter($page) {
    drupal_add_js(libraries_get_path('jquery.migrate') . '/jquery-migrate-1.2.1.min.js');
}


Now I can use all of the greatest and newest technologies in jQuery 1.9 and beyond while still being able to have Drupal 7 not crash on me!  AMEN!  HALLELUJAH!!!!