Jquery不会在wordpress中工作

This is probably a simple question to answer but my Jquery wont work on my theme at all no matter what tutorial ive followed.

my js file is located as /js/jquery.js and the code inside is just for testing purposes:

jQuery(document).ready(function($) {


$('#banner').hide();
});

my functions.php file is located in the same location as the index is and the code ive done for that is:

    <?php
function add_my_script() {
    wp_enqueue_script(
        'jquery', // name your script so that you can attach other scripts and de-register, etc.
        get_template_directory_uri() . 'js/jquery.js', // this is the location of your script file
        array('jquery') // this array lists the scripts upon which your script depends
    );
}
add_action( 'wp_enqueue_scripts', 'add_my_script' );
?>

and nothing happens... can anyone correct me in what I am doing wrong? This is what puts me off using wordpress.

Chances are you need to have a slash before "js":

get_template_directory_uri() . '/js/jquery.js'

With that said, you could check your site using the network monitor in your browser's developer tools. It will show you what URLs are being fetched. Or maybe just check your developer tool's console. It could show you a 404 error if it is unable to fetch your jQuery file.

wp_enqueue_script(
    'call this something else!', // name your script so that you can attach other scripts and de-register, etc.
    get_template_directory_uri() . '/js/jquery.js', // this is the location of your script file
    array('jquery') // this array lists the scripts upon which your script depends
);

you had a couple of typos.....also check if jquery is available by using your dev.console in chrome or firefox(right click on page, click inspect element, and then console) you'll get a error jquery undefined or similiar.

Also on your page in frontend:

get_header();
get_footer();

you dont use the head tags as these functions pull in the header file & footer files. without get_header() & get_footer - you'll have issues :)