So I'm trying to link in a javascript file the right way, by using this:
--functions.php--
function custom_scripts() {
wp_register_script('myscript','/backdrop.js',array('jquery'));
wp_enqueue_script('myscript');
console.log("test - inside custom_scripts");
}
add_action( 'wp_print_scripts', 'custom_scripts');
I don't see the console logs in the chrome console window, and I'm not sure if I should see them or not. However I see that one of my files cannot be found: /backdrop.js?ver=3.5.1
.
The directory is correct but the ?ver=3.5.1
obviously doesn't match up. Since I'm manually registering the script in a custom functions.php
, why does it still do this?