Datatable library conflicting on Other script

Asked

Viewed 201 times

0

I use this library below to run my tebela functionalities

 <script src="tables/datatables/assets/custom/js/datatables.init.js?v=v2.1.0"></script>

But this script below only works when the above library is not present. Removing it the script works perfectly someone knows how to get around it

<script type="text/javascript">
jQuery(document).ready(function(){
    jQuery('#ajax_form').submit(function(){
        var dados = jQuery( this ).serialize();

        jQuery.ajax({
            type: "POST",
            url: "acao_pax.php",
            data: dados,
            success: function( data )
            {
                $("#status").slideDown();
                $("#status2").slideDown();
                if (data != false) {

                $("#status").html("Passageiros Registrados com sucesso.");
                $("#status2").html("Passageiros Registrados com sucesso.");
                $("#bot").hide();

                //alert( data );
            }
            }
        });     
        return false;
    });
});
</script>

<div id="status" style="display: none; 
                    color: white; 
                    height: 50px; 
                    border-style: solid;
                    background-color: green;padding-left: 20px; padding-top: 8px; border-radius: 10px; font-size: 14px;"> </div>

   <form  name="Form1" method="POST"  action="" id="ajax_form"   enctype='multipart/form-data' >
   <input type="hidden" name="id_transfer" id="id_transfer" value="<?echo $id_transfer?>" />
   <input type="hidden" name="id_empresa"  id="id_empresa"value="<?echo $id_empresa?>" />
   <input type="hidden" name="id_cota"     id="id_cota"value="<? echo $id_cota?>" />btn-primary" class="form-control" /></div>

1 answer

0

You can try using noConflict() jQuery:

$.noConflict();
jQuery( document ).ready(function( $ ) {
  //
});

Browser other questions tagged

You are not signed in. Login or sign up in order to post.