Skip to content
HTMLPHPMSQL
2018.01.31 17:58

자바스크립트 명령어

조회 수 12894 추천 수 0 댓글 0
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄

특수문자 이스케이프 시퀀스

특수 문자(JavaScript)

 

JavaScript는 직접 입력할 수 없는 문자를 만들기 위해 문자열에 포함시킬 수 있는 이스케이프 시퀀스를 제공합니다.

 

function ConvertSystemSourcetoHtml(str){

 str = str.replace(/</g,"&lt;");

 str = str.replace(/>/g,"&gt;");

 str = str.replace(/\"/g,"&quot;");

 str = str.replace(/\'/g,"&#39;");

 str = str.replace(/\n/g,"<br />");

 return str;

}

 

HTML 특수 문자표 

 

 

표현문자

숫자표현

문자표현

설명

-

&#00;-&#08;

-

사용하지 않음

space

&#09;

-

수평탭

space

&#10;

-

줄 삽입

-

&#11;-&#31;

-

사용하지 않음

space

&#32;

-

여백

!

&#33;

-

느낌표

"

&#34;

&quot;

따옴표

#

&#35;

-

숫자기호

$

&#36;

-

달러

%

&#37;

-

백분율 기호

&

&#38;

&amp;

Ampersand

'

&#39;

-

작은 따옴표

(

&#40;

-

왼쪽 괄호

)

&#41;

-

오른쪽 괄호

*

&#42;

-

아스트릭

+

&#43;

-

더하기 기호

,

&#44;

-

쉼표

-

&#45;

-

Hyphen

.

&#46;

-

마침표

/

&#47;

-

Solidus (slash)

0 - 9

&#48;-&#57;

-

0부터 9까지

:

&#58;

-

콜론

;

&#59;

-

세미콜론

<

&#60;

&lt;

보다 작은

=

&#61;

-

등호

>

&#62;

&gt;

보다 큰

?

&#63;

-

물음표

@

&#64;

-

Commercial at

A - Z

&#65;-&#90;

-

A부터 Z까지

[

&#91;

-

왼쪽 대괄호

\

&#92;

-

역슬래쉬

]

&#93;

-

오른쪽 대괄호

^

&#94;

-

탈자부호

_

&#95;

-

수평선

`

&#96;

-

Acute accent

a - z

&#97;-&#122;

-

a부터 z까지

{

&#123;

-

왼쪽 중괄호

|

&#124;

-

수직선

}

&#125;

-

오른쪽 중괄호

~

&#126;

-

꼬리표

-

&#127;-&#159;

-

사용하지 않음

 

&#160;

&nbsp;

Non-breaking space

¡

&#161;

&iexcl;

거꾸로된 느낌표

&#162;

&cent;

센트 기호

&#163;

&pound;

파운드

¤

&#164;

&curren;

현재 환율

&#165;

&yen;

|

&#166;

&brvbar;

끊어진 수직선

§

&#167;

&sect;

섹션 기호

¨

&#168;

&uml;

움라우트

&#169;

&copy;

저작권

ª

&#170;

&ordf;

Feminine ordinal

&#171;

&laquo;

왼쪽 꺾인 괄호

&#172;

&not;

부정

 

&#173;

&shy;

Soft hyphen

?

&#174;

&reg;

등록상표

&hibar;

&#175;

&macr;

Macron accent

°

&#176;

&deg;

Degree sign

±

&#177;

&plusmn;

Plus or minus

²

&#178;

&sup2;

Superscript two

³

&#179;

&sup3;

Superscript three

´

&#180;

&acute;

Acute accent

μ

&#181;

&micro;

Micro sign (Mu)

&#182;

&para;

문단기호

·

&#183;

&middot;

Middle dot

¸

&#184;

&cedil;

Cedilla

¹

&#185;

&sup1;

Superscript one

º

&#186;

&ordm;

Masculine ordinal

&#187;

&raquo;

오른쪽 꺾인 괄호

¼

&#188;

&frac14;

4분의 1

½

&#189;

&frac12;

2분의 1

¾

&#190;

&frac34;

4분의 3

¿

&#191;

&iquest;

거꾸로된 물음표

A

&#192;

&Agrave;

Capital A, grave accent

A

&#193;

&Aacute;

Capital A, acute accent

A

&#194;

&Acirc;

Capital A, circumflex accent

A

&#195;

&Atilde;

Capital A, tilde

A

&#196;

&Auml;

Capital A, dieresis or umlaut mark

A

&#197;

&Aring;

Capital A, ring (Angstrom)

Æ

&#198;

&AElig;

Capital AE diphthong (ligature)

C

&#199;

&Ccedil;

Capital C, cedilla

E

&#200;

&Egrave;

Capital E, grave accent

E

&#201;

&Eacute;

Capital E, acute accent

E

&#202;

&Ecirc;

Capital E, circumflex accent

E

&#203;

&Euml;

Capital E, dieresis or umlaut mark

I

&#204;

&Igrave;

Capital I, grave accent

I

&#205;

&Iacute;

Capital I, acute accent

I

&#206;

&Icirc;

Capital I, circumflex accent

I

&#207;

&Iuml;

Capital I, dieresis or umlaut mark

Ð

&#208;

&ETH;

Capital Eth, Icelandic

N

&#209;

&Ntilde;

Capital N, tilde

O

&#210;

&Ograve;

Capital O, grave accent

O

&#211;

&Oacute;

Capital O, acute accent

O

&#212;

&Ocirc;

Capital O, circumflex accent

O

&#213;

&Otilde;

Capital O, tilde

O

&#214;

&Ouml;

Capital O, dieresis or umlaut mark

×

&#215;

&times;

Multiply sign

Ø

&#216;

&Oslash;

width="130"Capital O, slash

U

&#217;

&Ugrave;

Capital U, grave accent

U

&#218;

&Uacute;

Capital U, acute accent

U

&#219;

&Ucirc;

Capital U, circumflex accent

U

&#220;

&Uuml;

Capital U, dieresis or umlaut mark

Y

&#221;

&Yacute;

Capital Y, acute accent

Þ

&#222;

&THORN;

Capital Thorn, Icelandic

ß

&#223;

&szlig;

Small sharp s, German (sz ligature)

a

&#224;

&agrave;

Small a, grave accent

a

&#225;

&aacute;

Small a, acute accent

a

&#226;

&acirc;

Small a, circumflex accent

a

&#227;

&atilde;

Small a, tilde

a

&#228;

&auml;

Small a, dieresis or umlaut mark

a

&#229;

&aring;

Small a, ring

æ

&#230;

&aelig;

Small ae diphthong (ligature)

c

&#231;

&ccedil;

Small c, cedilla

e

&#232;

&egrave;

Small e, grave accent

e

&#233;

&eacute;

Small e, acute accent

e

&#234;

&ecirc;

Small e, circumflex accent

e

&#235;

&euml;

Small e, dieresis or umlaut mark

i

&#236;

&igrave;

Small i, grave accent

i

&#237;

&iacute;

Small i, acute accent

i

&#238;

&icirc;

Small i, circumflex accent

i

&#239;

&iuml;

Small i, dieresis or umlaut mark

ð

&#240;

&eth;

Small eth, Icelandic

n

&#241;

&ntilde;

Small n, tilde

o

&#242;

&ograve;

Small o, grave accent

o

&#243;

&oacute;

Small o, acute accent

o

&#244;

&ocirc;

Small o, circumflex accent

o

&#245;

&otilde;

Small o, tilde

o

&#246;

&ouml;

Small o, dieresis or umlaut mark

÷

&#247;

&divide;

Division sign

ø

&#248;

&oslash;

Small o, slash

u

&#249;

&ugrave;

Small u, grave accent

u

&#250;

&uacute;

Small u, acute accent

u

&#251;

&ucirc;

Small u, circumflex accent

u

&#252;

&uuml;

Small u, dieresis or umlaut mark

y

&#253;

&yacute;

Small y, acute accent

þ

&#254;

&thorn;

Small thorn, Icelandic

y

&#255;

&yuml;

Small y, dieresis or umlaut mark

 

 

 

 

 

특정글자 변경/삭제

 

str_text.replace("찾을 문자열", "변경할 문자열")

 

 

 자바스크립트 데이터 화면 출력

 

데이터 디스플레이와 관련된 명령어

 

● document.write( )  
: ()안에 것을 화면에 출력하라는 메서드
● window.alert()     
: 경고창을 띄워 ()안의 것을 출력하라는 메서드
 innerHTML=" "       
: 예를 가지고 이해하는 것이 빠르다. 
예를 들어 HTML로 [홍길동]이라는 콘텐츠를 화면에 출력하였다.
이 HTML 요소에 접근하여 [홍길동]을 [이순신]으로 바꿔 출력하게 만들려면 이 속성을 사용해야 한다. 그리고 HTML 요소에 접근하려면 document.getElementById 메서드를 함께 사용한다.
 

 

 

if문

var date = new Date();
var hour = date.getHours();
 
if(hour < 11) {
alert("아침");
}
else if(hour < 15) {
alert("점심");
}
else {
alert("저녁");
}

 

 

switch문

var input = Number(prompt('숫자를 입력하세요.', '숫자'));
 
switch(input % 2) {
case 0:
alert("짝수입니다.");
break;
case 1:
alert("홀수입니다.");
break;
default:
alert("숫자가 아닙니다.");
break;
}

 

 

while 반복문

1
2
3
4
5
value = 0;
while(value < 5) {
alert(value + '번째 반복');
value++;
}

do while 반복문

1
2
3
4
5
var value = 0;
do {
alert(value + '번째 반복문');
value++;
} while(value < 5);

for 반복문

1
2
3
4
5
var array = ['포도', '사과', '바나나', '망고'];
 
for(var i=0; i<array.length; i++) {
alert(array[i]);
}

for in 반복문

자바스크립트는 배열이나 객체를 더욱 쉽게 다룰 수 있도록 for in 반복문을 제공한다. 위 for 문의 예제는 아래와 같이 바꿔 사용할 수도 있다.

1
2
3
4
5
var array = ['포도', '사과', '바나나', '망고'];
 
for(var i in array) {
alert(array[i]);
}

 

 


http://meaningone.tistory.com/316

 

#자바스크립트 #데이터 #화면 #출력 #명령어

 

로그인 후 댓글쓰기가 가능합니다.

?

List of Articles
번호 분류 제목 날짜 조회 수
233 회로도전자부품 555타이머(555 timer 60Hz clock circuit) file 2017.11.02 5491
232 회로도전자부품 리튬폴리머 배터리 용량 설명서 file 2017.10.28 3842
231 회로도전자부품 알리익스프레스 전자부품 추가구입 리스트 file 2017.05.19 3994
230 회로도전자부품 간단한 전기 기차를 만드는 방법 2017.03.12 3832
229 회로도전자부품 간단한 CATV 증폭회로(Cable tv amplifier circuit) 2017.02.18 2780
228 회로도전자부품 휴대폰 진동원리를 알아보자 1 file 2016.12.09 7992
227 회로도전자부품 회로 시뮬레이션 사이트 1 file 2016.10.31 11176
226 회로도전자부품 간단한 주파수 만들기 file 2016.10.22 2328
225 회로도전자부품 SS8050 C945 2N2222 NPN TRANSISTOR DATASHEETS 2016.09.25 2815
224 회로도전자부품 [실험실] 2n2222 wireless power transfer circuit file 2016.09.19 2535
223 회로도전자부품 Standard Capacitor Values Conversion Chart pF - nF - uF 2016.09.11 1765
222 회로도전자부품 TV Signal Level Meter 5-870MHZ Spectrum Analysis(RY-S200D) file 2016.08.31 1787
221 회로도전자부품 텔레만 1702 설명서(USER MANUAL 1702/1703, 1720/1730) file 2016.08.31 2200
220 회로도전자부품 2.7V 500F 슈퍼캡 충전시키기 file 2016.02.16 1776
219 회로도전자부품 무선 전력 전송 회로도 (power wireless transfer circuit) 1 file 2016.02.03 2000
218 회로도전자부품 트랜지스터 and MOSFET 이용한 정전류 드라이버 file 2016.01.07 5819
217 회로도전자부품 거리 계산법 dbm, dbw, 거리 계산법 2015.12.30 2226
216 회로도전자부품 다이오드 2015.12.30 1339
215 회로도전자부품 CCTV 설치시 구성품/필수또는선택사항/주의사항/참고사항 file 2015.12.15 1870
214 회로도전자부품 CCTV 견적서 file 2015.12.14 1207
Board Pagination Prev 1 2 3 4 5 ... 13 Next
/ 13

http://urin79.com

우린친구블로그

sketchbook5, 스케치북5

sketchbook5, 스케치북5

나눔글꼴 설치 안내


이 PC에는 나눔글꼴이 설치되어 있지 않습니다.

이 사이트를 나눔글꼴로 보기 위해서는
나눔글꼴을 설치해야 합니다.

설치 취소