How do I enqueue jQuery in my plugin?
-
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 https://localhost:8888/wordpress/wp-admin/jquery-1.10.2.min.map 404 (Not Found)
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘How do I enqueue jQuery in my plugin?’ is closed to new replies.