PageSourceSearch

https://skv1-motors.com/js/common-submit.js

js skv1-motors.com collected 2026-09-24 14:18:29 UTC 3,201 bytes, 97 lines download raw bytes

1/*******************************************************************************
2 * 작성자   :   김명현
3 * 함수명   :   commonAjax();
4 * 기능 	: 	callurl로 ajax 요청을 하고 callBack( returnData ) 를 수행한다.
5 * 인수 	: 	formId            form의 id값
6 *              callurl           sumbit 할 url
7 *              loadingBar        로딩바 표출 여부 생략시 false
8 *              async             동기화 여부 생량시 true
9 *              errorCallBack     서비스익셉션 ERROR: 인 경우에도 콜백함수를 타야 될 경우 true 로 넘길것..(생략시 false)
10 *
11 * 사용예 	:
12 * 비고    :
13******************************************************************************/
14function commonAjax( data , callurl , callBack , loadingBar , async , errorCallBack) {
15
16	if( loadingBar == undefined) loadingBar = false;
17	if( async == undefined) async = true;
18	if( errorCallBack == undefined) errorCallBack = false;
19
20
21	$.ajax({
22		async: async,
23		type: "post",
24		url: callurl ,
25		data:data,
26		dataType: "json",
27		beforeSend: function() {
28			// 로딩바 show()
29			if( loadingBar ) { onLoading(); }
30		},
31		complete:function() {
32			// 로딩바 hide()
33			if( loadingBar ) { offLoading(); }
34		},
35		success:function(returnData){
36
37			if(typeof(returnData.message) != 'undefined' && returnData.message.startsWith("ERROR:") ) {
38				gfnAlert( returnData.message.replace("ERROR:","")  );
39				if( errorCallBack ) { // 서비스익셉션일 경우에도 콜백에서 처리할 경우가 있으면 true 로 보낼것 !!
40					callBack( returnData );
41				}
42			} else {
43				callBack( returnData );
44			}
45			// 로딩바 hide()
46			if( loadingBar ) { offLoading(); }
47		},
48		error:function(result){
49			if(result.status != 0) { // 0은 로딩중 네트워크가 끈긴거라.. 체크 뺌..
50				gfnAlert( '통신에러가 발생하였습니다.[' + result.status + ']:' + result.statusText);
51			}
52			// 로딩바 hide()
53			if( loadingBar ) { offLoading(); }
54		}
55	});
56
57}
58
59
60
61/*******************************************************************************
62 * 작성자   :   김명현
63 * 함수명   :   commonAjaxSubmit();
64 * 기능 	: 	callurl로 ajax 요청을 하고 callBack( returnData ) 를 수행한다.
65 * 인수 	: 	formId            form의 id값
66 *              callurl           sumbit 할 url
67 *              callBackFnName    실행될 콜백함수 이름
68 * 사용예 	:   파일 업로드 등의 ajaxSubmit 사용시 호출하여 사용함..
69 * 비고    :
70******************************************************************************/
71function commonAjaxSubmit( formId , callurl , callBackFnName ) {
72
73	onLoading();
74
75	$("#"+formId).ajaxSubmit({
76		url : callurl,
77		async: true,
78		type : 'post',
79		dataType: "json",
80		beforeSend: function() {
81			// 로딩바 show()
82			onLoading();
83		},
84		complete:function() {
85			// 로딩바 hide()
86			offLoading();
87		},
88		success:function(returnData){
89			eval( callBackFnName )("success" , returnData);
90			offLoading();
91		},
92		error:function(returnData){
93			eval( callBackFnName )("error" , returnData);
94			offLoading();
95		}
96	});
97}

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.