복불복망
443
2020-11-20 16:06:04 작성 2020-11-20 16:06:51 수정됨
5
116

Uncaught SyntaxError: missing ) after argument list 에러메세지 질문드립니다.



function fn_saveRoadCrcmr(){
	fnCmmConfirm("저장하시겠습니까?", function() {
		$("form[name=rosidLndslMngmeVO]").ajaxSubmit( dataType : "json" ,url: '<c:url value="/road/roadCrcmrLndslMngmeMod.do"/>', success :function(){
			var rosidLndslMngmeId = '${rosidLndslMngmeVO.rosidLndslMngmeId }';
			var param, feature;
			var roadPntLayer = fnCmmGetVectorLayer('roadPntLayer');
			var roadPlgnLayer = fnCmmGetVectorLayer('roadPlgnLayer');
			param = { ROSID_LNDS : rosidLndslMngmeId };

			
			
			var callback = function(res){
				
				count = res.getFeaturesEventArgs.result.featureCount;
				
				var tableName = res.userParams.tableName;
				var geometry = null
				if(tableName == "TB_LDM_ROSID_PNT"){
					geometry = res.userParams.callbackOptions.roadPntLayerGeometry;
				}else{
					geometry = res.userParams.callbackOptions.roadPlgnLayerGeometry;
				}
				
				var rosidLnds = res.userParams.callbackOptions.rosidLnds;
				
				if(count == 0){
					var searchOption = {
							attrObjValues : {"ROSID_LNDS" : rosidLnds},
							typeCUD : "insert",
							tableName : tableName,
							geometry : geometry
					};
					IserverDataEditObject.onIserverDataCUD(searchOption,  function(){
							
					});
					
					return ;
				}
				var smid = res.getFeaturesEventArgs.result.features[0].data.SMID;
				
				var searchOption = {
						smid : smid,
						typeCUD : "update",
						tableName : tableName,
						geometry : geometry
				};
				IserverDataEditObject.onIserverDataCUD(searchOption,  function(){
						
				});
			};
			
			var searchOp = {
					callbackOptions : {roadPntLayerGeometry : null , roadPlgnLayerGeometry : null , rosidLnds : rosidLndslMngmeId },
					arrIds : null,
					attrFieldNm : null,
					attrValue : null,
					sql : "ROSID_LNDS = '"+rosidLndslMngmeId+"'",
					tableName : null
			};
			if(roadPntLayer.features.length!=0){
				feature = roadPntLayer.features[0];
				searchOp.tableName = "TB_LDM_ROSID_PNT";
				searchOp.callbackOptions.roadPntLayerGeometry = feature.geometry.clone();
				IserverDataSearchObject.onSearchIserverData(searchOp , callback);
			}
			if(roadPlgnLayer.features.length!=0){
				feature = roadPlgnLayer.features[0];
				searchOp.tableName = "TB_LDM_ROSID_PLGN";
				searchOp.callbackOptions.roadPlgnLayerGeometry = feature.geometry.clone();
				IserverDataSearchObject.onSearchIserverData(searchOp , callback);
			}

			fnCmmAlert("성공적으로 저장되었습니다.", function(){
				PageManager.addPage("<c:url value='/road/roadCrcmrLndslMngmeView.do?rosidLndslMngmeId='/>"+rosidLndslMngmeId, "상세");
			});
		});
	});
}

이게 에러가 나는 스크립트이고..



Uncaught SyntaxError: missing ) after argument list
    at eval (<anonymous>)
    at jquery-1.11.1.min.js:2
    at Function.globalEval (jquery-1.11.1.min.js:2)
    at m.fn.init.domManip (jquery-1.11.1.min.js:3)
    at m.fn.init.append (jquery-1.11.1.min.js:3)
    at Object.success (common.js:765)
    at j (jquery-1.11.1.min.js:2)
    at Object.fireWith [as resolveWith] (jquery-1.11.1.min.js:2)
    at x (jquery-1.11.1.min.js:4)
    at XMLHttpRequest.b (jquery-1.11.1.min.js:4)

이게 에러 내용입니다.

괄호 ) 가 빠진건가 아무리 찾아봐도.. 맞게 되어있는 것 같은데

구문 에러가 아닌 뭔가 다른 에러인지 궁금합니다..

 (해당 스크립트를 지우거나 주석하면, 에러났을때 화면 가운데 뺑글뺑글 도는게 사라지고.

 다시 활성화시키면 에러가 나는게 저 부분이 에러인건 확실한것같습니다..)

0
  • 답변 5

  • yeori
    1k
    2020-11-20 16:11:11
    ajaxSubmit( dataType : "json" 

    여기 중괄호 빠졌네요

    ajaxSubmit({  dataType : "json" 
  • 복불복망
    443
    2020-11-20 16:45:03

    yeori

    말씀듣고 고쳐보고 계속해보고있습니다..



  • 복불복망
    443
    2020-11-20 16:50:38 작성 2020-11-20 16:51:08 수정됨

    yeori



    function fn_saveRoadCrcmr(){
    		fnCmmConfirm("저장하시겠습니까?", function() {
    			$("form[name=rosidLndslMngmeVO]").ajaxSubmit( dataType : "json" ,url: '<c:url value="/road/roadCrcmrLndslMngmeMod.do"/>', 
    			success :function(){
    			
    				var rosidLndslMngmeId = '${rosidLndslMngmeVO.rosidLndslMngmeId }';
    				var param, feature;
    				var roadPntLayer = fnCmmGetVectorLayer('roadPntLayer');
    				var roadPlgnLayer = fnCmmGetVectorLayer('roadPlgnLayer');
    				param = { ROSID_LNDS : rosidLndslMngmeId };
    
    				
    				
    				
    
    				fnCmmAlert("성공적으로 저장되었습니다.", function(){
    					PageManager.addPage("<c:url value='/road/roadCrcmrLndslMngmeView.do?rosidLndslMngmeId='/>"+rosidLndslMngmeId, "상세");
    				});
    			});
    	});
    	}


  • 복불복망
    443
    2020-11-20 17:10:11

    yeori


    function fn_saveRoadCrcmr(){
    	fnCmmConfirm("저장하시겠습니까?", function() {
    		$("form[name=rosidLndslMngmeVO]").ajaxSubmit({ dataType : "json" ,url: '<c:url value="/road/roadCrcmrLndslMngmeMod.do"/>', success :function(){
    		
    			var rosidLndslMngmeId = '${rosidLndslMngmeVO.rosidLndslMngmeId }';
    			var param, feature;
    			var roadPntLayer = fnCmmGetVectorLayer('roadPntLayer');
    			var roadPlgnLayer = fnCmmGetVectorLayer('roadPlgnLayer');
    			param = { ROSID_LNDS : rosidLndslMngmeId };
    
    			
    			
    			var callback = function(res){
    				
    				count = res.getFeaturesEventArgs.result.featureCount;
    				
    				var tableName = res.userParams.tableName;
    				var geometry = null
    				if(tableName == "TB_LDM_ROSID_PNT"){
    					geometry = res.userParams.callbackOptions.roadPntLayerGeometry;
    				}else{
    					geometry = res.userParams.callbackOptions.roadPlgnLayerGeometry;
    				}
    				
    				var rosidLnds = res.userParams.callbackOptions.rosidLnds;
    				
    				if(count == 0){
    					var searchOption = {
    							attrObjValues : {"ROSID_LNDS" : rosidLnds},
    							typeCUD : "insert",
    							tableName : tableName,
    							geometry : geometry
    					};
    					IserverDataEditObject.onIserverDataCUD(searchOption,  function(){
    							
    					});
    					
    					return ;
    				}
    				var smid = res.getFeaturesEventArgs.result.features[0].data.SMID;
    				
    				var searchOption = {
    						smid : smid,
    						typeCUD : "update",
    						tableName : tableName,
    						geometry : geometry
    				};
    				IserverDataEditObject.onIserverDataCUD(searchOption,  function(){
    						
    				});
    			};
    			
    			var searchOp = {
    					callbackOptions : {roadPntLayerGeometry : null , roadPlgnLayerGeometry : null , rosidLnds : rosidLndslMngmeId },
    					arrIds : null,
    					attrFieldNm : null,
    					attrValue : null,
    					sql : "ROSID_LNDS = '"+rosidLndslMngmeId+"'",
    					tableName : null
    			};
    			if(roadPntLayer.features.length!=0){
    				feature = roadPntLayer.features[0];
    				searchOp.tableName = "TB_LDM_ROSID_PNT";
    				searchOp.callbackOptions.roadPntLayerGeometry = feature.geometry.clone();
    				IserverDataSearchObject.onSearchIserverData(searchOp , callback);
    			}
    			if(roadPlgnLayer.features.length!=0){
    				feature = roadPlgnLayer.features[0];
    				searchOp.tableName = "TB_LDM_ROSID_PLGN";
    				searchOp.callbackOptions.roadPlgnLayerGeometry = feature.geometry.clone();
    				IserverDataSearchObject.onSearchIserverData(searchOp , callback);
    			}
    
    			fnCmmAlert("성공적으로 저장되었습니다.", function(){
    				PageManager.addPage("<c:url value='/road/roadCrcmrLndslMngmeView.do?rosidLndslMngmeId='/>"+rosidLndslMngmeId, "상세");
    			});
    		}});
    	});
    }


    감사합니다 드디어 됐네요~ 후아 

  • yeori
    1k
    2020-11-20 22:41:04

    크으 ~~의지의  한국인!!!

  • 로그인을 하시면 답변 을 등록할 수 있습니다.