Quantcast
Channel: WordPress › Support » Forum: Hacks - Recent Topics
Viewing all articles
Browse latest Browse all 8245

greathug2u on "How do I enqueue jQuery in my plugin?"

$
0
0

Hi,

Can somebody please tell me how to properly enqueue jQuery into my plugin code?
I did this:

if (is_admin()) add_action( "wp_enqueue_scripts", "my_jquery_enqueue", 11 );
function my_jquery_enqueue() {
   wp_deregister_script( 'jquery' );
   wp_register_script( 'jquery', "http" . ( $_SERVER['SERVER_PORT'] == 443 ? "s" : "" ) . "://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js", false, null );
   wp_enqueue_script( 'jquery' );
}

And it didn't work. I opened the console and got this message:
GET http://localhost:8888/wordpress/wp-admin/jquery-1.10.2.min.map 404 (Not Found)


Viewing all articles
Browse latest Browse all 8245

Trending Articles