/    Sign up×
Community /Pin to ProfileBookmark

Problem loading jQuery script from custom file in WordPress

Hello. I have problem to load jquery script from created file (myscriptos.js) to all my pages (to header). First I tried to load my scripts by using wp_enqueue_script to my functions.php file and create new js file (myscriptos.js). Used this lines:
(function wpb_adding_scripts() {
wp_register_script(‘mujscript’, get_template_directory_uri() . ‘/myscriptos.js’, array(‘jquery’),’1.0′, false);
wp_enqueue_script(‘mujscript’);
}
add_action( ‘wp_enqueue_scripts’, ‘wpb_adding_scripts’ );

Then when I checked in source code on updated site It has appeared.

Then I have pasted this code to the new js file (myscriptos.js):

$(document).ready(function(){
$(“#button0”).click(function(){
$(“#button1”).fadeToggle();
$(“#button2”).fadeToggle(“slow”);
$(“#button3”).fadeToggle(3000);
});
});

Then I saved it, and created these buttons on the top of this site, this script supposed to do: When I click on Button0(black one) then Button 1,2 and 3 should fade. But nothing is happening and it does not seem the script is loading. And be understandable I am newbie so It could be noob question. Could you please somebody help me? Thank you in advance.
For whole desciptions of problem with picture is this link:
http://travelerky.cz/tryingmyfirstjqueryonwp/?preview_id=646&preview_nonce=71889ba01d&preview=true#

to post a comment
JavaScript

0Be the first to comment 😎

×

Success!

Help @Adina spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 4.23,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...