-
Notifications
You must be signed in to change notification settings - Fork 0
/
2017-04-27.txt
107 lines (76 loc) · 3.29 KB
/
2017-04-27.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
템플레이트 가서
템플릿 가서 web jsp
객체안에 있는 것은 메소드
함수는 기능 코드만 따로 있는것
<meta charset=UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
<title>JSP Page</title>
<link href="/WebApplication/resources/bootstrap-3.3.7/css/bootstrap.min.css" rel="stylesheet" type="text/css"/>
<script src="/WebApplication/resources/jquery/jquery-3.2.1.min.js" type="text/javascript"></script>
<script src="/WebApplication/resources/bootstrap-3.3.7/js/bootstrap.min.js" type="text/javascript"></script>
추가 하면은 기본적으로 생성할때 생겨나만들어진다.jsp 파일 같은 경우는
web 템플릿에 주기적으로 추가하기 부트트랩 이랑 jquery 로 확인한다.
인덱스는 총길이 빼기 -1
-----------------------------------WebBrowoser---------------------------------------------
함수 글로벌 함수 글로벌 함수는
그냥 사용해해도 된다.
bom 이라는 객체들이 있다.(Browser object model)
(window location)
Dom 이라는 객체 들이 있다.(Browser object model)
----------------------------------------------------------------------------------------------
<script>
글로벌 함수는 안에서 얼마든지 사용이 가능하다.
BOM 안에 있는 객체를 가지고 오기 위해서는
window.메소드();로 해서 접근이 가능하다
Dom 안에 있는 객체를 가지고 오기 위해서는
<div>. 메소드();
Bom 은 브라우저 자체에 대한 정보를 가지고 있는 객체 넓이나 높이
Dom 은 도규먼트에 대한 정보 Html 문서의 정보 내부의 정보나 값을 변경할때는 DOM 을 이용을 한다.
Dom 은 HTML 기반으로 해서 만들어 진다.<html><body></body></html>
Dom 도 자식 부모 관계를 가진다.
</script>
--------------------------------------------------------------------------------------------------
clearInterval()
clearTimeout()
open()
고급 설정
글로벌 은 객체를 생성안하고 사용이 가능하다.
Bom Dom 은 알아서 객체를 만들어줘서 이름으로 접근이 가능하다
객체명으로 접근이 가능하다 그래서 소문자를 사용한다. W3C 정의 된 객체 img div h3 등등 태그들
BOM하고 DOM 은 W3C 에서 정의
jQuery 자바 라이브러리
var img1=window.document.querySelector("#id"); 리턴하는 객체는w3c dom 객체 이다.
var img1=$("#id"):리턴해주는것이 jquery 객체이다.
jquery 안에는 w3cdom 객체를 저장하는 배열이 있다.
img1 은 dom 도큐먼트를 찾아본다.
img1은 jquery 도큐먼트를 찾아본다.
로드 완료 함수
자바 코드는%로 감싸면 된다.
도큐먼트에
.메소드() 이것은 어떤 객체를 찾아와서 써라
var div=$("#div");
div.메소드를 써라 이런 뜻이다.
.jquery()-> $.메소드를 써라 이런 뜻이다.
약식표현으로 표현 해라
ajax 는 URL 과 setting 을 같이 넣던지
URL 은 String 타입이다
setting 만 넣던가 두가지 경우가 있다.
setting 는 객체이다.
자바스크립트에서 객체는 {}로 표시를 한다.
코어부분 가서 ->jQuery() 가서 확인
$(function() {
// Document is ready
});
비동기
아작스
요청을 해서 페이지 변경을 하는게 아니라
일부분만 변경을 하는 것이다
a.html 이 서버에 요청을 하면은 일부분만 HTML 조각을 받아와서 일부분만 변경을 시킨다
전체를 변화시키기 위해서는 페이지 이동을 해야 되는 것이지만
비동기 방식으로 HTML 조각을 받던가 JSON 데이터를 받을 수도 있다.
AJAX(비동기) 방식으로 요청을 하면 조각을응답해준다.전체 중에서 일부분만 변화시키고 싶을때
HTML 조각이나 JSON 데이타로 보낸다.
<%@page contentType="application/json" pageEncoding="UTF-8"%> 제이슨 타입은 이렇게 쓴다. json 은 배열 로 쓴다.
제이슨 데이터를 받아온다 제이슨 데이터는 배열안에 객체가 들어있다.
데이터만 제공해주는 것은 json 으로 보통해준다.
XML 이나 제이슨 으로