1
Eea guys td well? I’m developing a project with Materialize and in this project is giving error in JS, can you help me? I’ll be putting the code next:
<script src="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0-beta/js/materialize.min.js" type="text/javascript"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js" type="text/javascript"></script>
<script src="http://demo.expertphp.in/js/jquery.js"></script>
<script src="http://demo.expertphp.in/js/jquery-ui.min.js"></script>
$(document).ready(function() {
Materialize.updateTextFields();
$('.sidenav').sidenav();
$('.fixed-action-btn').floatingActionButton();
$('select').formSelect();
});
document.addEventListener('DOMContentLoaded', function() {
var elems = document.querySelectorAll('.fixed-action-btn');
var instances = M.FloatingActionButton.init(elems, {
direction: 'top',
hoverEnabled: false
});
});
In your example gives the error Uncaught Referenceerror: $ is not defined, because it is importing the Materialize before the jQuery, and the second is a requirement of the first.
– Woss
Enter the jquery first.
– Netinho Santos
nothing yet, n is working
– Victor Gabriel
As of 1.0 alpha, jQuery is no longer a dependency, this is one of the reasons I use Materialize.
– Dobrychtop