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

 

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

 

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

?

  1. 24
    Jan 2015
    15:09

    Windows XP 부팅속도 개선 팁

    CategoryWindowsTip Views1412
    Read More
  2. 24
    Jan 2015
    11:52

    (nPDF) 프린터 인쇄 내용을 PDF 파일로 변환하기

    CategoryWindowsTip Views2273
    Read More
  3. 23
    Jan 2015
    12:56

    JAVA 7 다운로드

    CategoryWindowsTip Views5893
    Read More
  4. 22
    Jan 2015
    13:42

    공유기의 공인IP(Wan) 미할당으로 안되는 증상이 잦은경우 대처방법

    CategoryWindowsTip Views1967
    Read More
  5. 22
    Jan 2015
    13:08

    exFAT 이동식 USB 하드 쓰기 금지 문제 해결방법

    CategoryWindowsTip Views3107
    Read More
  6. 22
    Jan 2015
    13:07

    usb 쓰기가 금지되어 있습니다 해제방법

    CategoryWindowsTip Views1827
    Read More
  7. 14
    Jan 2015
    09:00

    윈도우 XP에서 exFAT 인식 패치방법

    CategoryWindowsTip Views1557
    Read More
  8. 09
    Jan 2015
    18:20

    알리익스프레스에서 산 ralink 802.n usb driver

    CategoryWindowsTip Views1521
    Read More
  9. 09
    Jan 2015
    07:01

    도스용 파티션 매직

    CategoryWindowsTip Views2325
    Read More
  10. 09
    Jan 2015
    06:40

    ISO 파일을 USB로 굽기(USB 윈도우 설치 디스크 만들기)

    CategoryWindowsTip Views4885
    Read More
  11. 09
    Jan 2015
    06:32

    복구콘솔 USB 만들기

    CategoryWindowsTip Views1539
    Read More
  12. 08
    Jan 2015
    23:26

    컴퓨터가 많이 느리다면?

    CategoryWindowsTip Views1777
    Read More
  13. 08
    Jan 2015
    23:24

    XP USB 부팅디스크 만들기 & 고스트

    CategoryWindowsTip Views2089
    Read More
  14. 07
    Jan 2015
    11:59

    애드웨어 클리너

    CategoryWindowsTip Views6856
    Read More
  15. 27
    Dec 2014
    12:45

    마이크로소프트 윈도우가 제공하는 기본적인 실행명령어 모음.

    CategoryWindowsTip Views6305
    Read More
  16. 27
    Dec 2014
    12:40

    autohotkey regwrite ipv6 제거툴

    CategoryWindowsTip Views1540
    Read More
  17. 27
    Dec 2014
    08:59

    윈도우 빠른종료 팁

    CategoryWindowsTip Views1821
    Read More
  18. 23
    Dec 2014
    18:09

    익스플로러 ftp 정상화 시키기

    CategoryWindowsTip Views1660
    Read More
  19. 13
    Dec 2014
    14:07

    엑셀에서 날짜합계 구하는 함수(Sumproduct 함수 이해하기)

    CategoryExcel Views9906
    Read More
  20. 11
    Nov 2014
    08:35

    PHP강좌 MySQL 연동

    CategoryHTMLPHPMSQL Views5801
    Read More
Board Pagination Prev 1 ... 14 15 16 17 18 ... 46 Next
/ 46

http://urin79.com

우린친구블로그

sketchbook5, 스케치북5

sketchbook5, 스케치북5

나눔글꼴 설치 안내


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

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

설치 취소