본문 바로가기

php 헛다리/Laravel9 헛다리

라라벨9 admin Lte 04 - 사용자.js 사용법 , jQuery 사용법

728x90

라라벨9 admin Lte 04 - 사용자.js 사용법 , jQuery 사용법

1. 사용자.js 사용법

라라벨9 admin Lte 02 대시보드 파일기준

 

/resources/views/layout_default.blade.php 레이아웃 파일

@extends('adminlte::page')




@section('footer')
        <strong>Copyright &copy; 2024 <a href="/">lara3</a>.</strong>
        All rights reserved.
@stop



@section('adminlte_js')
        @parent
        {{--사용자js--}}
        <script src="{{ asset('js/custom.js') }}"></script>
@stop

 

라라벨은 루트 경로가 /public/ 이다.

{{ asset('js/custom.js') }} 경로는 /public/js/custom.js

js , img , css 경우도 동일

 


 

 

2. jQuery 사용법 , 사용자의 스크립트 사용법

 

/resources/views/dashboard/dashBoard_ver1.blade.php 

@extends( $arr_return_data['cfg_pageLayout'] ) {{--@extends('layout.layout_default')--}}

@section('title', 'Custom Dashboard')

@section('adminlte_css')
    <link rel="stylesheet" href="{{ asset('css/custom.css') }}">
@stop

@section('content_header')
    <h1>Dashboard</h1>
@stop

@section('content')
    <pre>
        =================================================================================
        - 대시보드 완료
        - AdminLte 완료
    </pre>

    <button id="btn01">jQuery 테스트</button>
@stop


@push('css')
    <style>
        /* Custom CSS here */
    </style>
@endpush

@push('js')
    <script>
        // Custom JS here
        jQuery(document).on("click","#btn01",function () {
            alert("jQuery 동작 성공");
        })
    </script>
@endpush

 

@push('js') 사용

728x90