반응형
반응형


반응형

jquery dialog 정리


 
 
var opt = {
		        autoOpen: true,
		        modal: true,
		        title: '입력확인'
		};

		var 데이터=$('#데이터').val(); //데이터 가져오기
		var rdata={content: input, tpage: page}; //파싱
		var data=JSON.stringify(rdata) //json언기

		var theDialog = $("#이름").dialog(opt); //다이얼 로그 옵션 탑재

		theDialog.dialog("open"); //오픈하여라
		
		$('#이름').dialog({ //다이얼로그 가할일
			autoOpen: false, //자동오픈 켜기,끄기
        , width : "500px"            // dialog 넓이 지정
        , height : "500px"        // dialog 높이 지정
        , modal : true            // dialog를 modal 창으로 띄울것인지 결정
        , resizeable : false    // 사이즈 조절가능 여부

			resizable: false,
 create: function (event, ui) {  
                },  //생성될때 할일
                open: function (event, ui) {  
                },  //오픈됬을때 할일
                close: function () {  
                },  //닫을때 할일
                cancle: function () {  
                } //취소했을때 할일 지정
			buttons: [ //버튼 탑재
				{
					text: "OK", //ok버튼을 누를시 ajax 할일 진행
					click: function() {
							$.ajax({  //ajax
								type : "POST", //보내는 형식
						        url : "/url", //url
						        dataType : "text", //보내는 데이터 타입
						        async: false, 
								data : data, //보내는 데이터 위에 var data
								contentType: "application/json;charset=utf-8",
 //보내는 받아오는 타입을 맞춰줘야함
								success : function(response) {
									//ajax 성공시 할일
								},
								error : function(request, status, error) {
									if (request.status != '0') {
										
alert("code:"+request.status+"\n"+"message:"+request.responseText+"\n"+"error:"+error); //에러 메시지 출력
									}
								}

							});
 




반응형

'코딩' 카테고리의 다른 글

Ioc 컨테이너 Di  (0) 2016.11.02
2016/06/13 HTML5  (0) 2016.06.13
If_Switch_For-1  (0) 2016.04.06
자료형 연산자-3  (0) 2016.04.06
자료형 연산자-2  (0) 2016.04.05


반응형
 
/*
           [관계 연산자]
		   -두값의 대소를 비교
		   >,>=,==(같다),<,<=,!=(같지않다.)


*/
class Test01 {
	public static void main(String[] args) {
		int a =10 , b=20;

		boolean b1=a==b;
		boolean b2=a!=b;

		System.out.println("b1:"+b1);
		System.out.println("b2:"+b2);
	}
}
 /*
       [논리 연산자]
	   !(not) : 어떠한 값이 참이면 거짓 , 거짓이면 참으로 바꿈
	   &&(and) : 대응되는 값이 모두 참이면 참 , 아니면 거짓
	   ||(or): 대응 되는 값이 모두 거짓이면 거짓 , 아니면 참
	   
*/
import java.util.Scanner;
class Test02 {
	public static void main(String[] args){
		Scanner scan = new Scanner(System.in);
		System.out.println("면접점수");
		int interview=scan.nextInt();
		System.out.println("영어점수");
		int eng=scan.nextInt();
		if(interview>=80 && eng>=90 ){
			System.out.println("당신은 합격입니다.");
		}else{
			System.out.println("당신은 불합격입니다.");
		}
          

	}
}


 
/*
         [대입 연산자]
		 --------------------------------------
		 연산자         의미
		 --------------------------------------
		 a+=b             a=a+b
		 a-=b              a=a-b
		 a*=b              a=a*b
		 a/=b              a=a/b
		 ...
*/
class Test03 
{
	public static void main(String[] args) 
	{
		int a=3, b=4, c=5, d=6;
		a+=10;//a=a+10
		b-=5;//b=b-5
		c*=2;//c=c*2
		d/=3;//d=d/3
		System.out.println("a:"+a);
		System.out.println("b:"+b);
		System.out.println("c:"+c);
		System.out.println("d:"+d);
	}
}
 class Test04 {
	public static void main(String[] args) {
		int a=2;
		int b=5;
		int c=a|b;//대응 되는 비트값이 하나라도 참이면 참
		int d=a&b;//대응 되는 비트 값이 모두 참이면 참
		int e=a^b;//대응되는 비트값이 서로 다르면 참

		System.out.println("c"+c);
		System.out.println("d"+d);
		System.out.println("e"+e);
	}
}


반응형

'코딩' 카테고리의 다른 글

Ioc 컨테이너 Di  (0) 2016.11.02
2016/06/13 HTML5  (0) 2016.06.13
jquery dialog  (0) 2016.04.27
자료형 연산자-3  (0) 2016.04.06
자료형 연산자-2  (0) 2016.04.05


반응형
 
 
/*
   [조건 연산자 (삼항 연산자)]
   형식
   (조건식)?결과값1:결과값2;
   -조건식이 참이면 결과값1, 조건식이 거짓이면 결과값2 을 연산결과로  얻음
*/
import java.util.Scanner;
class MyTest09 {
	public static void main(String[] args){
		int a,b;
		int max;
		Scanner scan=new Scanner(System.in);
		System.out.println("첫번째수");
		a=scan.nextInt();
		System.out.println("두번째수");
		b=scan.nextInt();
		max=(a>b)?a:b;
		System.out.println(a+"와 " + b+"중 큰수는 " +max +"입니다.");
	}
}

/*
 자신의 이름 국어 영어 수학 점수를 입력 받아 
 총점 평균을 구해서 출력해보자
*/
import java.util.Scanner;
class Quiz01 {
	public static void main(String[] args) {
		String name=null;
		int kor,eng,math,tot;
		double ave;

		Scanner scan=new Scanner(System.in);
		System.out.println("이름입력");
		name=scan.next();
		System.out.println("국어 점수 입력");
		kor=scan.nextInt();
		System.out.println("영어 점수 입력");
		eng=scan.nextInt();
		System.out.println("수학 점수 입력");
		math=scan.nextInt();

		tot=kor+eng+math;
		//ave=(double)tot/3;
		ave=tot/3.0;

		System.out.println("학생이름:"+name);
		System.out.println("국어점수:"+kor);
		System.out.println("영어점수:"+eng);
		System.out.println("수학점수:"+math);
		System.out.println("총점:"+tot);
		System.out.println("평균:"+ave);
		


		
	}
}





 
 /*
 자신의 이름 국어 영어 수학 점수를 입력 받아 
 총점 평균을 구해서 출력해보자
*/
import java.util.Scanner;
class Quiz01 {
	public static void main(String[] args) {
		String name=null;
		int kor=0;
		int eng=0;
		int math=0;
		int avg=0;

		Scanner scan=new Scanner(System.in);
		System.out.println("이름입력");
		name=scan.next();
		System.out.println("국어 점수 입력");
		kor=scan.nextInt();
		System.out.println("영어 점수 입력");
		eng=scan.nextInt();
		System.out.println("수학 점수 입력");
		math=scan.nextInt();

		avg=(kor+eng+math)/3;

		System.out.println("학생이름:"+name);
		System.out.println("국어점수:"+kor);
		System.out.println("영어점수:"+eng);
		System.out.println("수학점수:"+math);
		System.out.println("총점:"+avg);
		


		
	}
}

/*
      임의의 정수를 입력받아 조건연산자를 사용하여 절대값을 구해 보세요.
	  예1)
	  임의의 수입력 10
	  10의 절대값은 10입니다.
	  예2)
	  임의의 수입력:-10
	  -10의 절대값은 10입니다.
*/
import java.util.Scanner;
class Quiz02{
	public static void main(String[] args) {
		int a;
		int b;
		Scanner scan=new Scanner(System.in);
		System.out.println("임의의 수");
		a=scan.nextInt();
		b=(a>=0)?a:-a;
		System.out.println(a +"의 절대값은 "+b); 


	}
}
 
반응형

'코딩' 카테고리의 다른 글

Ioc 컨테이너 Di  (0) 2016.11.02
2016/06/13 HTML5  (0) 2016.06.13
jquery dialog  (0) 2016.04.27
If_Switch_For-1  (0) 2016.04.06
자료형 연산자-2  (0) 2016.04.05

+ Recent posts