mercredi 6 mai 2015

not loading the content of a remote file

I have a file edit.blade.php. I want to load content in a div with load ajax

@if(Auth::check() && Auth::user()->admin)
@section('modal_body')
      @if($errors->any())
        <div class='alert alert-danger'>
            <a href="#" class="close" data-dismiss="alert">&times;</a>
            @foreach($errors->all() as $error)
                {{ $error }} <br/>
            @endforeach
        </div>
        @endif
    {{ Form::open(array('id' =>'formuser-create', 'role' => 'form', 'class' => 'form-horizontal')) }}
            <div class="form-group">
                {{ Form::label('user', 'Nombre de usuario', array('class' => 'col-md-4 control-label')) }}
                <div class="col-md-5">
                    {{ Form::text('user','', array('placeholder' => 'Introduce la contraseña...', 'class' => 'form-control input-md')) }} 
                    <div id="user_error"></div>
                </div>
            </div>
            <div class="form-group">
                {{ Form::label('email', 'Email', array('class' => 'col-md-4 control-label')) }}
                <div class="col-md-5">
                    {{ Form::text('email','', array('placeholder' => 'Introduce el email...', 'class' => 'form-control input-md')) }} 
                    <div id="email_error"></div>
                </div>
            </div>
            <div class="form-group">
                {{ Form::label('es_admin', '¿Es administrador?', array('class' => 'col-md-4 control-label')) }}
                <div class="col-md-5">
                    {{ Form::checkbox('es_admin','1') }}
                </div>
            </div>
@stop

I want to load the content in a div, but not get loading

enter image description here

Here my file where I call load, but I get how response status 404 not found

 var modal_title = $(this).find('.modal-title');
       var modal_body = $(this).find('.modal-body');
       //var modal_footer = $(this).find('.modal-footer');

       switch(accion)
       {
            case 'create':
               modal_title.html('<i class="fa fa-user-plus"></i> Nuevo usuario');   
               break;
            case 'edit':
               modal_title.html('<i class="fa fa-pencil fa-fw"></i> Editar usuario');
               modal_body.load('includes/edit.blade.php');
               break;

The error throwed is:

Failed to load resource: the server responded with a status of 404 (Not Found)

Aucun commentaire:

Enregistrer un commentaire