How can I load jquery library into my dashboard widget?
<p>I'm attempting to use wp_enqueue_script('jquery') to load the builtin WP jquery library but my jquery functions aren't working when I do this. Only when I hardcode a reference to the script do my functions work...</p>

<p>Example that works... (this is inside my functions.php file, which is adding a dashboard widget)...</p>

<pre><code>/* Dashboard Widget */
if(is_admin())
{
function my_dashboard_widget_function() 
{ 
    $rss = fetch_feed( "http://mysite/my.rss" );
    if ( is_wp_error($rss) ) 
    {
        if ( is_admin() || current_user_can('manage_options') ) 
        {
            echo '&lt;p&gt;';
            printf(__('&lt;strong&gt;RSS Error&lt;/strong&gt;: %s'), $rss-&gt;get_error_message());
            echo '&lt;/p&gt;';
        }
     return;
    }

    if ( !$rss-&gt;get_item_quantity() ) 
    {
        echo '&lt;p&gt;This feed is currently offline&lt;/p&gt;';
        $rss-&gt;__destruct();
        unset($rss);
        return;
    }
echo "&lt;script type='text/javascript' src='http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js'&gt;&lt;/script&gt;"

echo "&lt;script type='text/javascript'&gt;//some jquery methods here&lt;/script&gt;";
</code></pre>

<p>Example that does not work...</p>

<pre><code>/* Dashboard Widget */
if(is_admin())
{
function my_dashboard_widget_function() 
{ 
    $rss = fetch_feed( "http://mysite/my.rss" );
    if ( is_wp_error($rss) ) 
    {
        if ( is_admin() || current_user_can('manage_options') ) 
        {
            echo '&lt;p&gt;';
            printf(__('&lt;strong&gt;RSS Error&lt;/strong&gt;: %s'), $rss-&gt;get_error_message());
            echo '&lt;/p&gt;';
        }
     return;
    }

    if ( !$rss-&gt;get_item_quantity() ) 
    {
        echo '&lt;p&gt;This feed is currently offline&lt;/p&gt;';
        $rss-&gt;__destruct();
        unset($rss);
        return;
    }
wp_enqueue_script('jquery');
echo "&lt;script type='text/javascript'&gt;//some jquery methods here&lt;/script&gt;";
</code></pre>
