AJAX if($this->request->is('ajax')) { // Force le controller à rendre une réponse JSON. $this->RequestHandler->renderAs($this, 'json'); // Définit le type de réponse de la requete AJAX $this->response
AJAX dans une boucle for ```javascript for(var i = 0; i < contacts.length; i++) { $.ajax({ url: href, type: "post", data: datas, success: function(response) { if(!response.result) { alert('Tu as tout planté
Ajax. Le module est terminé à 90%, disons. Le soucis vient de l'insertion des données dans la DB de manière asynchrone. En gros : * Afficher le chat via Ajax : Ok. * Refresh
ajax Cette page est ensuite envoyé dans le layout par defaut. Pour rendre cette pagination Ajax, j'ai suivi les indications du book :http://book.cakephp.org/2.0/fr/core-libraries/helpers/js.html#ajax-pagination (en bas de page
ajax qui me renvoi un contenu html issue d'une vue créer pour l'occasion. ``` $.ajax({ url: "/pages/projets", data: { page: currentPage, categorie: $(this).val() }, dataType: 'html', type: 'get', success: function
Ajax. Cependant, je retrouve cette erreur "ArticleBundle\Entity\Article object not found." ### Ce que je fais Voici mon appel Ajax : ``` $(document).on('keyup', '.search', function() { var searchVal = $(this).val(); $.ajax
ajax, mais malheureusement mon problème est la. Le pourcentage change ce qui est normal car je recharge ajax, et la requete ajax prend pour valeur le deuxième identifiant du tableau
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. Tout d'abord j'ai initisialiser masonry et infiscroll comme si je n'utilise pas d'ajax. ``` // init masonry var $container = $('#msnry-container'); $container.masonry({ itemSelector : '.article-item', Width: 200, }); // init
ajax se lance pour aller chercher les informations correspondante en BDD. Vue que chaque champ fait partie d'une suite logique, si la premiére et modifié, celle d'aprés relance