向Laravel页面添加JS脚本
我正在尝试创建我的第一个Laravel站点,但我不知道如何将JS文件添加到我的一个页面中 我只想在这个页面上使用JS文件,而不想在其他地方使用 如何让我的页面加载JS文件 我的目录结构如下:向Laravel页面添加JS脚本,laravel,laravel-4,blade,Laravel,Laravel 4,Blade,我正在尝试创建我的第一个Laravel站点,但我不知道如何将JS文件添加到我的一个页面中 我只想在这个页面上使用JS文件,而不想在其他地方使用 如何让我的页面加载JS文件 我的目录结构如下: apply js myjsfile.js apply.blade.php 在我的apply.blade.php中 @extends('layouts.master') @section('content') <div class="row"> <
apply
js
myjsfile.js
apply.blade.php
在我的apply.blade.php中
@extends('layouts.master')
@section('content')
<div class="row">
<div id="applicationForm" class="col-md-9 col-xs-12">
...
</div>
</div>
@extends('layouts.master'))
@节(“内容”)
...
layouts.master文件
<!DOCTYPE html>
<html>
<head>
@include('includes.head')
</head>
<body>
<div class="container">
<div id="header">
@include('includes.header')
</div>
@yield('content')
<div id="footer">
@include('includes.footer')
</div>
</div>
</body>
</html>
@include('includes.head')
@include('includes.header')
@产量(‘含量’)
@include('includes.footer')
您的apply.blade.php
@extends('layouts.master')
@section('content')
<div class="row">
<div id="applicationForm" class="col-md-9 col-xs-12">
...
</div>
</div>
@stop
@section('myjsfile')
<script src="js/myjsfile.js"><script>
@stop
我将把@section位放在哪里?我希望我的所有JS文件都加载到页脚中。
<!DOCTYPE html>
<html>
<head>
@include('includes.head')
</head>
<body>
<div class="container">
<div id="header">
@include('includes.header')
</div>
@yield('content')
<div id="footer">
@include('includes.footer')
</div>
</div>
@yield('myjsfile')
</body>
</html>