I have created a new page on my website: / and added jquery source file :
<script type="text/javascript" src=".js"></script>
which is on 1034 line of code and after that my main navigation menu disappears completely for some reason. The menu is fully visible on other parts of the website. I need to keep that jquery file in order for some other page parts to work for me.
What I can do to keep that Jquery file there and make navigation visible again?
Thanks
I have created a new page on my website: https://membership.gai-edu.eu/country-qualification/ and added jquery source file :
<script type="text/javascript" src="https://code.jquery/jquery.js"></script>
which is on 1034 line of code and after that my main navigation menu disappears completely for some reason. The menu is fully visible on other parts of the website. I need to keep that jquery file in order for some other page parts to work for me.
What I can do to keep that Jquery file there and make navigation visible again?
Thanks
Share Improve this question asked Mar 13, 2020 at 19:43 Boris ŽegaracBoris Žegarac 32 bronze badges1 Answer
Reset to default 0jQuery is already being included on the page, so you don't need to include it again.
I'm assuming your adding that because you want to run the JS below it?
$(document).ready(function() {
$("#countryChooser").change(function() {
if ($(this).val() !== "") {
var selector = "." + $(this).val();
$('.box').not(selector).hide();
$(selector).show();
} else {
$(".box").hide();
}
}).change();
});
If that's the case, remove the additional call to load jQuery, then change all the $
to jQuery
.
For example...
jQuery(document).ready(function() {
jQuery("#countryChooser").change(function() {
if (jQuery(this).val() !== "") {
var selector = "." + jQuery(this).val();
jQuery('.box').not(selector).hide();
jQuery(selector).show();
} else {
jQuery(".box").hide();
}
}).change();
});