salut je suis pas douer en ajax alors j'ai pris une fonction toute prête mais je n'arrive pas a l’intégrer a symfony voici le code:


Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
$(".productPriceWrapRight a img").click(function() {
		var productIDValSplitter 	= (this.id).split("_");
		var productIDVal 			= productIDValSplitter[1];
 
 
		if ($("#slidingTopContent").is(":visible")) {
 
			$("#notificationsLoader").html('<img src="/themeAmm/images/loader.gif">');
 
			$.ajax({  
			type: "POST",  
			url: "/produit/update",  
			data: { productID: productIDVal, action: "updateproduit"},  
			success: function(theResponse) {
 
				if( $("#productID_" + productIDVal).length > 0){
					$("#productID_" + productIDVal).animate({ opacity: 0 }, 500);
					$("#productID_" + productIDVal).before(theResponse).remove();
					$("#productID_" + productIDVal).animate({ opacity: 0 }, 500);
					$("#productID_" + productIDVal).animate({ opacity: 1 }, 500);
					$("#notificationsLoader").empty();
 
				} else {
					$("#basketItemsWrap li:first").before(theResponse);
					$("#basketItemsWrap li:first").hide();
					$("#basketItemsWrap li:first").show("slow");  
					$("#notificationsLoader").empty();			
				}
 
			}  
			}); 
 
		} else {
 
			$("#slidingTopContent").slideToggle("slow", function(){		
												fonction $ajax dans symfony				 
 
 
$("#slidingTopFooterLeft").html('<img src="/themeAmm/images/arrow-up.png" alt="Hide Basket" /> <a href="aaa.htm" onclick="return false;" id="slidingTopTrigger">Hide Basket</a>');
				$("#notificationsLoader").html('<img src="/themeAmm/images/loader.gif">');
 
				$.ajax({  
				type: "POST",  
				url: "/produit/update",  
				data: { productID: productIDVal, action: "updateproduit"},  
				success: function(theResponse) {
 
					if( $("#productID_" + productIDVal).length > 0){
						$("#productID_" + productIDVal).animate({ opacity: 0 }, 500);
						$("#productID_" + productIDVal).before(theResponse).remove();
						$("#productID_" + productIDVal).animate({ opacity: 0 }, 500);
						$("#productID_" + productIDVal).animate({ opacity: 1 }, 500);
						$("#notificationsLoader").empty();
 
					} else {
						$("#basketItemsWrap li:first").before(theResponse);
						$("#basketItemsWrap li:first").hide();
						$("#basketItemsWrap li:first").show("slow");  
						$("#notificationsLoader").empty();			
					}
 
				}  
				});
j'ai un route qui est :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
updateproduit:
  url:  /updateproduit
  param: { module: produit, action: update }
mais quand je met
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
$.ajax({  
			type: "POST",  
			url:/updateproduit
sa marche pas mieux