Php 没有在所有页面中加载laravel 4 jquery脚本
我在一个Laravel项目中包括了jquery和bootstrap 我将文件夹组织如下:Php 没有在所有页面中加载laravel 4 jquery脚本,php,jquery,twitter-bootstrap,laravel,laravel-4,Php,Jquery,Twitter Bootstrap,Laravel,Laravel 4,我在一个Laravel项目中包括了jquery和bootstrap 我将文件夹组织如下: 应用程序/视图/ 在视图内部,有home.blade.php文件和两个文件夹:layout和account 应用程序/视图/布局 应用程序/视图/帐户 在布局中,有main.blade.php,其中包含了完整的HTML代码。这是我指定引导文件和jQuery文件的位置的地方: <!DOCTYPE html> <html> <head> <
- 应用程序/视图/
- 应用程序/视图/布局
- 应用程序/视图/帐户
<!DOCTYPE html>
<html>
<head>
<title>Authentication system</title>
{{ HTML::style('/css/bootstrap.min.css') }}
{{ HTML::style('/css/bootstrap-theme.min.css') }}
</head>
<body>
@if(Session::has('global'))
<p>{{Session::get('global')}}</p><!--It can be a div, span, etc-->
@endif
@include('layout.navigation')
<div class="container">
@yield('content')
<p style="color: red;">End of everything</p>
</div><!--Fin del div class container-->
<!-- Javascript Files required for page-->
<script src="js/jquery-1.11.1.min.js"></script>
<script src="js/bootstrap.min.js"></script>
<!--Referencias:http://stackoverflow.com/questions/11124777/twitter-bootstrap-navbar-fixed-top-overlapping-site-->
<script>
$(document).ready(function(){
$(document.body).css('padding-top', $('#topnavbar').height() + 25);
$(window).resize(function(){
$(document.body).css('padding-top', $('#topnavbar').height() + 25);
});
});
</script>
</body>
</html>
<p style="color: red;">End of everything</p>
这告诉我,对于app/views/account/(更深一层)中的页面,jQuery没有被加载。我被困在这里了。出什么事了?我感到困惑,因为每个页面的其余元素都被正确加载或读取。例如,我在脚本标记(我称之为jQuery文件)的前面(或上面)添加了以下消息:
一切都结束了
我在所有的页面上都看到了这条信息。
那么为什么没有加载jQuery脚本呢?我如何解决这个问题?你把JS文件放在哪里?试着像这样加载它们{{HTML::script('JS/jquery-1.11.1.min.JS');}}}}哇,@Shibi!成功了!谢谢
@extends('layout.main')
@section('content')
<form action="{{URL::route('account-forgot-password-post')}}" method="post">
<div class="field">
Email: <input type="email" name="email"{{ (Input::old('email')) ? ' value="'.e(Input::old('email')).'"' : ''}}>
@if($errors->has('email'))
{{ $errors->first('email') }}
@endif
</div>
<input type="submit" value="Recover">
{{ Form::token()}}
</form>
@stop
ReferenceError: $ is not defined
$(document).ready(function(){
<p style="color: red;">End of everything</p>