0
I’m having a problem in a function using Jquery and a file I call inside my html that are giving conflict, it’s only working one, I tried using jQuery.noConflict() but apparently it didn’t work, I don’t know I used it correctly follows the script and call that are conflicting:
<script>
var $JQuery = jQuery.noConflict()
$jQuery(document).ready(function($) {
$(".page-scroll").click(function(event){
event.preventDefault();
$('html,body').animate({scrollTop:$(this.hash).offset().top}, 1000);
});
});
</script>
<script src="/js/demo.js"></script>
What’s wrong with you?
– Sergio
The first script is to scroll the page when clicked on the menu, for some reason it does not run, and when I remove this demo.js file, the menu works normally. accessing the demo.js file it is minified, but I identified that the problem is in this part: "Document"in self&("classList"in Document.createelement("")?!Function(){"use Strict";var e=Document.createelement(""); :/
– Rafael
And there is no error message? Are you loading how many versions of jQuery? Is this a Wordpress site? can you add more details? The code of
demo.js
it may be useful to see also.– Sergio
is giving me an error in creating noConflict() <script type="text/javascript"> var $Jquery = jQuery.noConflict() </script> Uncaught Referenceerror: jQuery is not defined the site is in wordpress, and I am only loading a version of Jquery
– Rafael
You got the jQuery loaded? What’s up
console.log(jQuery);
at first?– Sergio
By the way! What gives
console.log(typeof jQuery);
?– Sergio
Thank you very much for your help Sergio, I was able to solve it with Oeslei’s explanation
– Rafael