Getting Google jQuery to Load
-
I have looked at various tutorials and whatnot but am still having trouble getting it to load.
In my functions.php file I have:
function my_scripts() { wp_deregister_script( 'jquery' ); wp_register_script( 'jquery', 'https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js'); wp_enqueue_script( 'jquery' ); } add_action('wp_enqueue_scripts', 'my_scripts');
And then in my test file I simply have the following:
if (typeof jQuery != 'undefined') { alert("jQuery library is loaded!"); }else{ alert("jQuery library is not found!"); }
When I hardcode the script call into header.php, the test works fine. When I attempt to use the function above, I get the not found error and there is no script tag in the HTML header.
Am I missing something?
Viewing 14 replies - 1 through 14 (of 14 total)
Viewing 14 replies - 1 through 14 (of 14 total)
- The topic ‘Getting Google jQuery to Load’ is closed to new replies.