select2 is not working in AdminLTE

It suffers me a lot. It takes a lot of time from me to research and solve the problem. The problem was very simple. I have faced the problem and solved it. Main problem was select2 doesn't get ajax.googleapis cdn. So, before the jQuery code I have loaded the cdn and it works fine now. Firstly, the code was

    <script>
        $(document).ready(function() {
            $('.js-example-basic-multiple').select2();
        });
    </script>
The problem is looked like the picture below


Now after adding the cdn before the script tag. it has been solved the problem and the code looks like below

    <script src="https://code.jquery.com/jquery-3.4.1.js" integrity="sha256-WpOohJOqMqqyKL9FccASB9O0KwACQJpFTUBLTYOVvVU=" crossorigin="anonymous"></script>
      <script>
        $(document).ready(function() {
            $('.js-example-basic-multiple').select2();
        });
    </script>

Now it is seen like below

Comments

Popular posts from this blog

composer installation on aws ec2 instance ami ubuntu 18.04

nginx installation on aws ec2 instance ami ubuntu 18.04

PHP7.3 installation on aws ec2 instance ami ubuntu 18.04