Uncaught Error ReferenceError: Materialize is not defined

1

Hey, how are you guys? I'm developing a project with Materialize and this project is giving error in JS, can you help me? I'll be putting the following code:

<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><scriptsrc="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
   });
   });
    
asked by anonymous 28.05.2018 / 16:44

1 answer

0

Victor, you are certainly referring to the wrong version of the documentation. In fact you are again using a version of Materialize and calling the Scripts from the old version!

See this is the link to the old documentation Prefilling Old Text Inputs

But if you are using the 1.0.0-rc1 version then you need the documentation for this link Prefilling Text Inputs NEW

  $(document).ready(function() {
    M.updateTextFields();
  });

Then do not use Materialize.updateTextFields(); use instead of

M.updateTextFields(); // opção correta!
    
28.05.2018 / 17:09