sAjaxSource with htaccess

sAjaxSource with htaccess

sofianesofiane Posts: 1Questions: 1Answers: 0

I use htaccess for my php application, now i want to use datatable api for get result from php file, my code:

$(document).ready(function() { var myTable=$('#resolus').dataTable( { "bProcessing": true, "bServerSide": true, //"bFilter": false, "sAjaxSource": "http://localhost/framework/public/js/requete_admin_resolus.php", "fnServerParams": function ( aoData ) { aoData.push({"name":"critere","value":$("select[name='choix'] option:selected").val()}); }, "sPaginationType": "full_numbers", "aaSorting": [[ 0, "desc" ]], "aoColumns": [ null, null, null, null, {"bSortable": false }, null, {"bSortable": false } ], "fnDrawCallback": function() { $('#resolus tbody tr td').each(function(){ $(this).css('border','1px solid black'); $(this).css('text-align','center'); }), $("#resolus tbody tr").hover( function () { $(this).css("background-color","#F7951E"); $(this).css('cursor','pointer'); }, function () { $(this).css("background-color","white"); $(this).css('cursor','auto'); } ); $("#resolus tbody tr").click(function () { /* CLICK SUR UN ENREGISTREMENT */ mapopup("admin_detail.php?id="+$(this).find('td:first').text()+"&solution=1") } ); }, "fnInitComplete":function() { $(".dataTables_filter").wrap("
"); $('
Rechercher dans:Num IncidentDateNom - PrénomIdentifiantProblème
').insertBefore(".dataTables_filter"); $('
').insertAfter("#rechercher"); $('').insertAfter(".dataTables_filter :text"); $('.rech').click(function(){ myTable.fnFilter($('.dataTables_filter :text').val()); }); $('.dataTables_filter :text') .unbind('keypress keyup') .bind('keypress', function(e){ if (e.keyCode != 13) return; myTable.fnFilter($(this).val()); }); }, "oLanguage": { "sProcessing": "Traitement en cours...", "sLengthMenu": "Nombre de lignes par page: _MENU_", //"sLengthMenu": "", "sZeroRecords": "Aucun élément à afficher", //"sInfo": "Affichage de l'�lement _START_ � _END_ sur _TOTAL_ �l�ments", "sInfo": "", //"sInfo": "", //"sInfoEmpty": "Affichage de l'�lement 0 � 0 sur 0 �l�ments", "sInfoEmpty": "", //"sInfoFiltered": "(filtr� de _MAX_ �l�ments au total)", "sInfoFiltered": "", "sInfoPostFix": "", "sSearch": "", "sUrl": "", "oPaginate": { "sFirst": "<<", "sPrevious": "< Précédent", "sNext": "Suivant >", "sLast": ">>" } } } ); } );
    </head>

    <body>
<TABLE class='table table-striped table-bordered' width="100%" id="resolus">
                                    <thead>
                    <TR>
                                                <TH>Num incident</TH>
                                                <TH>Date création</TH>
                                                <TH>Nom Prénom</TH>
                                                <TH>Identifiants</TH>
                                                <TH>Télephone</TH>
                                                <TH>Description problème</TH>
                                                <TH>Dernier dépannage</TH>
                    </TR>
                                    </thead>
                                    <tbody>
                                            <tr>
                                                    <td colspan="7" class="dataTables_empty">Chargement des données...</td>
                                            </tr>
                                    </tbody>
                </TABLE>    

- a result of requete_admin_resolus.php is echo json_encode( $output );
- my htaccess in public folder:(i have another htaccess file in main folder but it redirect file to htacces of public folder)
<IfModule mod_rewrite.c>
RewriteEngine On

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

RewriteRule ^(.*)$ index.php?url=$1 [PT,L,QSA]

</IfModule>

this url doesn't work, if i try to do that without htaccess it work even with this url, absolute url or relative url. i think that it's a problem about htaccess and json result. sorry for my english. thank for all.

This discussion has been closed.