title: Injecting jquery code from child and jquery include in parent [Blade - Laravel]
body: <p>im using laravel and blade for templates. I have a problem, i have a base template called (base.blade.php), where i include all js files (jQuery too). </p>
  
  <p>The problem comes when im child template (myadpack.blade.php extends from base.blade.php). I want to use jQuery in child, but it seems to be impossible, i can do normal js calls, but not using jQuery (that is included in parent). I paste these files here:</p>
  
  <p><strong>base.blade.php</strong></p>
  
  <pre><code>&lt;!DOCTYPE HTML&gt;
  &lt;html&gt;
  &lt;head&gt;
      &lt;title&gt;Tonhits&lt;/title&gt;
      &lt;meta charset="utf-8" /&gt;
  
      &lt;meta name="viewport" content="width=device-width, initial-scale=1" /&gt;
      &lt;link rel="stylesheet" href="{{ asset('css/font-awesome.min.css') }}" /&gt;
      &lt;link rel="stylesheet" href="{{ asset('css/bootstrap-theme.css') }}" /&gt;
      &lt;link rel="stylesheet" href="{{ asset('css/main.css') }}" /&gt;
      &lt;link rel="stylesheet" href="{{ asset('css/table.css') }}" /&gt;
      &lt;link rel="stylesheet" href="{{ asset('css/tablesaw.css') }}" /&gt;
      &lt;link rel="stylesheet" href="{{ asset('http://cdn.datatables.net/1.10.11/css/jquery.dataTables.min.css') }}" /&gt;
  
      @section('css')
      @show
  
  
  
  &lt;/head&gt;
  &lt;body class="no-sidebar"&gt;
  &lt;div id="page-wrapper"&gt;
  
      &lt;!-- Header Wrapper --&gt;
      &lt;div id="header-wrapper"&gt;
  
          &lt;!-- Header --&gt;
          &lt;div id="header" class="container"&gt;
  
              &lt;!-- Logo --&gt;
              &lt;h1&gt;&lt;a id="logo"&gt;Tonhits&lt;/a&gt;&lt;/h1&gt;
  
              &lt;!-- Nav --&gt;
              @include('nav/nav_anon')
  
          &lt;/div&gt;
  
      &lt;/div&gt;
  
      &lt;!-- Main Wrapper --&gt;
      &lt;div id="main-wrapper"&gt;
  
          &lt;!-- Main --&gt;
          &lt;div id="page" class="container"&gt;
  
              &lt;!-- Main Heading --&gt;
              &lt;div class="title-heading"&gt;
                  &lt;h2&gt;@yield('titleBig')&lt;/h2&gt;
                  &lt;p&gt; @yield('titleSmall')&lt;/p&gt;
              &lt;/div&gt;
  
              &lt;!-- Main Content --&gt;
              &lt;div id="main"&gt;
                  &lt;div class="row"&gt;
                      &lt;div id="content" class="12u"&gt;
                          &lt;!-- &lt;header&gt;
                              &lt;h2&gt;Nunc fringilla dis natoque amet gravida turpis&lt;/h2&gt;
                          &lt;/header&gt; --&gt;
                          @section('content')
                          @show
                      &lt;/div&gt;
                  &lt;/div&gt;
              &lt;/div&gt;
              &lt;!-- Main Content --&gt;
  
          &lt;/div&gt;
          &lt;!-- Main --&gt;
  
      &lt;/div&gt;
  
  
  
      &lt;!-- Copyright --&gt;
      &lt;div id="copyright"&gt;
          Tonhits. All rights reserved
      &lt;/div&gt;
  
  &lt;/div&gt;
  &lt;!-- Scripts --&gt;
  
  
  &lt;script src="{{ asset('js/jquery.min.js') }}"&gt;&lt;/script&gt;
  &lt;script src="{{ asset('js/jquery.dropotron.min.js') }}"&gt;&lt;/script&gt;
  &lt;script src="{{ asset('js/skel.min.js') }}"&gt;&lt;/script&gt;
  &lt;script src="{{ asset('js/util.js') }}"&gt;&lt;/script&gt;
  &lt;script src="{{ asset('js/main.js') }}"&gt;&lt;/script&gt;
  &lt;script src="{{ asset('js/tablesaw.js') }}"&gt;&lt;/script&gt;
  &lt;script src="{{ asset('http://cdn.datatables.net/1.10.11/js/jquery.dataTables.min.js') }}"&gt;&lt;/script&gt;
  
  @yield('js')
  
  
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p><strong>myadpack.blade.php</strong></p>
  
  <pre><code>@extends('base')
  
  @section('titleBig',    'Me')
  @section('titleSmall',  'My adpack overwiev')
  
  
  &lt;/script&gt;
  @section('js')
  &lt;script type="text/javascript" &gt;
          $(document).on('ready', function(){
              alert("a");
          });
          &lt;/script&gt;
  @endsection
  
  
  @section('content')
  
  
      Here you can see your purchased adpacks, so you can have a detailed tracing.
      &lt;table id="adpacks"&gt;
          &lt;tr&gt;
              &lt;th&gt;Test&lt;/th&gt;
              &lt;th&gt;Test&lt;/th&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;Data&lt;/td&gt;
              &lt;td&gt;Data 2&lt;/td&gt;
          &lt;/tr&gt;
  
      &lt;/table&gt;
  @endsection
  </code></pre>
  
  <p>In parent i tried with yield, section, and nothing.</p>
  
  <p>What it could be?</p>
  
  <p>Thank you for reading me.</p>