1BX.ready(function() { 2 /** 3 * Get successfully submitted form id 4 * @return {String} id id of the form 5 */ 6 function getSuccessFormId() { 7 var id = ''; 8 $('.mfeedback[id^="mfeedback_"]').each(function () { 9 if (window.location.search.search($(this).data('hash')) >= 0) { 10 id = this.id; 11 } 12 }); 13 return id; 14 } 15 16 var successForm = getSuccessFormId(); 17 if (successForm.length > 0) { 18 window.location.hash = successForm; 19 } 20 21 22 $.fn.serializeToObject = function() 23 { 24 var object = {}; //Ñоздаем обÑÐµÐºÑ 25 var a = this.serializeArray(); //ÑеÑиализиÑÑем в маÑÑив 26 $.each(a, function() { //пÑÐ¾Ñ Ð¾Ð´Ð¸Ð¼ÑÑ Ð¿Ð¾ маÑÑÐ¸Ð²Ñ Ð¸ добавлÑем паÑамеÑÑ name как Ð¸Ð¼Ñ ÑвойÑÑва обÑекÑа и value как его знаÑение 27 if (object[this.name] !== undefined) { //не забÑваем пÑовеÑиÑÑ Ð´Ð°Ð½Ð½Ñе 28 if (!object[this.name].push) { 29 object[this.name] = [object[this.name]]; 30 } 31 object[this.name].push(this.value || ''); 32 } else { 33 object[this.name] = this.value || ''; 34 } 35 }); 36 return object; 37 }; 38 39 40 $(document).on("submit", "form.callback_form", function(e){ 41 e.preventDefault(); 42 //ÑÐ±Ð¾Ñ Ð¿Ð°ÑамеÑÑов ÑоÑÐ¼Ñ Ð¸ оÑпÑавка Ð¸Ñ ÑеÑез ajax 43 var obParams = $( this ).serializeToObject(); 44 obParams.is_ajax = 'Y'; 45 $.ajax({ 46 url: "/ajax/rsv/check_file.php", 47 //method: "POST", 48 type: 'POST', 49 data: obParams, 50 dataType: "json", 51 success: function(data){ 52 //console.log(data); 53 if (data.is_OK=='Y') { 54 var prn = $(e.target).closest('.mcallback'); 55 var gd = $(prn).siblings('.mf-msg-good'); 56 gd.text(data.message); 57 prn.hide(); 58 gd.show(); 59 } else { 60 var err = $(e.target).find('.mf-msg-error'); 61 err.text(data.message); 62 err.show(); 63 } 64 $.fancybox.update(); 65 } 66 }); 67 return false; 68 }); 69 70 71 72});
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.