1function showRequest(formData, jqForm, options) { 2 // formData is an array; here we use $.param to convert it to a string to display it 3 // but the form plugin does this for you automatically when it submits the data 4 // var queryString = $.param(formData); 5 6 // jqForm is a jQuery object encapsulating the form element. To access the 7 // DOM element for the form do this: 8 var formElement = jqForm[0]; 9 10 $(formElement).parent().addClass('adding') 11 .find('.hop').animate({ 12 'right': "-180px", 13 'top': "-300px", 14 'opacity': '.25' 15 },500); 16 17 // alert('About to submit: \n\n' + queryString); 18 19 // here we could return false to prevent the form from being submitted; 20 // returning anything other than false will allow the form submit to continue 21 return true; 22} 23 24// post-submit callback 25function showResponse(responseText, statusText, xhr, $form) { 26 // for normal html responses, the first argument to the success callback 27 // is the XMLHttpRequest object's responseText property 28 29 // if the ajaxForm method was passed an Options Object with the dataType 30 // property set to 'xml' then the first argument to the success callback 31 // is the XMLHttpRequest object's responseXML property 32 33 // if the ajaxForm method was passed an Options Object with the dataType 34 // property set to 'json' then the first argument to the success callback 35 // is the json data object returned by the server 36 var qte = $(".minipanier .qte").text(); 37 var qte = parseInt(qte)+1; 38 39 //if(parseInt(qte)<=1) txt='article'; 40 //if(parseInt(qte)>1) txt='articles'; 41 42 $(".minipanier .qte").text(qte); 43 //$(".minipanier .txt").text(txt); 44 45 $form.parent().removeClass('adding') 46 .find('.hop') 47 .clearQueue() 48 .css({ 49 'right':'-34px', 50 'top':'3px', 51 'opacity':'1' 52 }); 53 54 // alert('status: ' + statusText + '\n\nresponseText: \n' + responseText + 55 // '\n\nThe output div should have already been updated with the responseText.'); 56} 57 58var ajout_panier = function(){ 59 var options = { 60 // target: '#loadme', // target element(s) to be updated with server response 61 beforeSubmit: showRequest, // pre-submit callback 62 success: showResponse // post-submit callback 63 64 // other available options: 65 //url: url // override for form's 'action' attribute 66 //type: type // 'get' or 'post', override for form's 'method' attribute 67 //dataType: null // 'xml', 'script', or 'json' (expected server response type) 68 //clearForm: true // clear all form fields after successful submit 69 //resetForm: true // reset the form after successful submit 70 71 // $.ajax options can be used here too, for example: 72 //timeout: 3000 73 }; 74 75 // bind form using 'ajaxForm' 76 $('.bouton_acheter form').ajaxForm(options); 77 78}; 79 80jQuery(document).ready(function(){ 81 //si javascript est desactive on ne met pas le nombre d'articles choisis! 82 // dans le cas contraire, on affiche 83 $(".count").show(); 84 ajout_panier(); 85}); 86 87onAjaxLoad(function(){ 88 ajout_panier(); 89}); 90 91
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.