PageSourceSearch

https://twizzle.ru/local/components/rsv/form.callback/templates/.default/script.js?17878675091948

js twizzle.ru collected 2026-10-02 06:34:54 UTC 1,948 bytes, 72 lines download raw bytes

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.