0

This got me so confused, I am not using the layouts.app of make:auth.

Here's my head tag of my layouts.master

 <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta http-equiv="x-ua-compatible" content="ie=edge">
    <meta name="csrf-token" content="{{ csrf_token() }}">

    <title>ZIAN PAYROLL SYSTEM</title>
    <link rel="stylesheet" href="/css/app.css">
    <script src="{{ asset('js/app.js') }}"></script>
    <link rel="stylesheet" href="{{asset('css/custom.css')}}">

 </head>

and here's my script:

<script>
    $('#promote').on('show.bs.modal', function(event){
        var button = $(event.relatedTarget)
        var name = button.data('myname')
        var id = button.data('myid')
        var modal = $(this)

        console.log(id);
        modal.find('.modal-body #myname').val(name);
        modal.find('.modal-body #myid').val(id);
    })  
</script>

Followed some steps here in stack yet nothing helped. I know that removing the defer in the script would work but mine wouldn't.

kwestionable
  • 496
  • 2
  • 8
  • 23

1 Answers1

0

You should add the jQuery library in your document. For example:

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta http-equiv="x-ua-compatible" content="ie=edge">
    <meta name="csrf-token" content="{{ csrf_token() }}">

    <title>ZIAN PAYROLL SYSTEM</title>
    <link rel="stylesheet" href="/css/app.css">
    <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
    <script src="{{ asset('js/app.js') }}"></script>
    <link rel="stylesheet" href="{{asset('css/custom.css')}}">

 </head>
mgarcia
  • 5,669
  • 3
  • 16
  • 35