ajax $(document).ready(function() { var Ville = ''; var Category = ''; var Partner = ''; var POST; $("#city-id").bind('change', function(e) { e.preventDefault(); Ville = $(this).find("option:selected").attr('value'); // $("#product-container").slideUp('slow'); $("#product-container #filters").find(".city").remove(); if ($(this).find("option:selected").text() !== "Ou ?") { $("#product-container #filters").append(" " + $(this).find("option:selected").text() + " "); } go(); }) $("#partner-id").bind('change', function(e) { e.preventDefault(); Partner = $(this).find("option:selected").attr('value'); // $("#product-container").slideUp('slow'); $("#product-container #filters").find(".partner").remove(); if ($(this).find("option:selected").text() !== "Qui ?") { $("#product-container #filters").append(" " + $(this).find("option:selected").text() + " "); } go(); }) $("#category-id").bind('change', function(e) { e.preventDefault(); Category = $(this).find("option:selected").attr('value'); //$("#product-container").slideUp('slow'); $("#product-container #filters").find(".marque").remove(); if ($(this).find("option:selected").text() !== "Quoi ?") { $("#product-container #filters").append(" " + $(this).find("option:selected").text() + " "); } go(); }) function go() { POST = {Deal: {city_id: Ville, category_id: Category, partner_id: Partner}}; $.ajax({ type: 'POST', url: 'fronts/test', data: POST, success: function(data) { $("#product-container ").slideDown('slow'); $("#product-container #container1").html(data); }, error: function(data) { alert('An unexpected error has occurred!'); $("#product-container ").slideDown('slow'); $("#product-container #container1").html(' errooor '); } }); } }); j'ai fais une fonction de test dans le contrôleur **FrontsController** juste pour tester , public function test(){ die('Contenu Ajax'); } public function test(){ die('Contenu Ajax'); } le problème c'est dans
AJAX j'ai voulu supprimer une entrée en AJAX... Voyez vous mon erreur? a mon avis je renseigne mal le nom du formulaire dans le code ajax ? code ajax dans
ajax; voici ce que je fais : un appel ajax qui doit retourner un nombre depuis le controller; bref qqchose de tres simple : mon appel ajax ``` $( "#test" ).click(function() { var nombre
ajax. le code fonction tres bien et le fichier php me revoir bien success en cas de succes mais ajax execute le code error. dans le mm temps quand le php renvoir
Ajax:** ``` $(document).ready(function() { $('#updateprofile').on('submit', function(e){ form = $('form#updateprofile') button = form.find('button'); $.ajax({ url: './users/update.php', type: 'POST', data: $(this).serialize(), dataType: 'json', beforeSend: function() { $(".spinner-grow").removeClass
ajax({ type: "POST", url:"index", cache: false, data:data, datatype:"json", success: function(data){ alert(data); } error : function(data){ alert('petits soucis dans ton ajax'); } }); }); Ce code ne s'exécute
ajax, sans que la page se raffraichisse Voici mon formulaire ``` Informations Personnelles Nom * Prénom * Adresse mail * Téléphone portable Je vous écoute... Objet * Vous avez un projet à m'exposer ? *
AJAX, on obtient la page initial sans aucun contenu Ajax chargé ou encore mieux, le bon contenue Ajax chargé. Par exemple : On est sur la page avec aucun contenue Ajax
ajax({ url : 'index.php?c=Contact&a=relance&ajax=true', type : 'POST', data : formDatas, dataType : 'JSON' }) .done(function(data, text, jqxhr){ content.html('Envoi terminé ! '+jqxhr.responseText ); }) .fail(function(jqxhr){ content.html( ' Erreur : '+jqxhr.responseText
ajax_nopriv_voteme_ajaxhandler', 'voteme_ajaxhandler' ); add_action( 'wp_ajax_voteme_ajaxhandler', 'voteme_ajaxhandler' ); mon script ajax : function votemeadd(author_id,nonce) { $.ajax({ type: "POST", url: votemeajax.ajaxurl, data: { action: 'voteme