¹®¼­ ÁÖ¼ÒÀÇ Á¦ÀÏ ¾Õ¿¡ ³ª¿À´Â ÄÝ·Ð(:)±îÁöÀÇ ¼Û½Å ¹æ½ÄÀ» ³ªÅ¸³»´Â ¹®ÀÚ¿­ Á¤º¸¸¦ ¹ÝȯÇϰųª ¼³Á¤ÇÑ´Ù.

Àμö
object : (°³Ã¼ À̸§)

¿¬°á °³Ã¼ÀÇ À̸§ÀÌ´Ù.

: (¼Ó¼º ¹®ÀÚ¿­)
¼Ó¼º°ªÀº ¹®¼­ ÁÖ¼ÒÀÇ Á¦ÀÏ ¾Õ¿¡ ³ª¿À´Â ÄÝ·Ð(:)±îÁöÀÇ ¼Û½Å ¹æ½ÄÀ» ³ªÅ¸³»´Â ¹®ÀÚ¿­ÀÌ´Ù.

ÀÌ ¼Ó¼ºÀº Àбâ/¾²±âÀÌ¸ç µðÆúÆ®°ªÀº ¾ø´Ù.

±¸¹®
document.write(location.protocol)
document.links[0].protocol='Val'
protocolÀÇ Á¾·ù

protocol ¼Ó¼ºÀº ¹®¼­ÀÇ ¼Û½Å¹æ¹ýÀ» ³ªÅ¸³»´Â ¹®ÀÚ¿­·Î ¹®¼­ÀÇ Á¦ÀÏ Ã³À½ ºÎºÐÀ¸·Î ÄÝ·Ð(:)±îÁö¸¦ Æ÷ÇÔÇϸç,
http:, ftp;, mailto:µîÀ¸·Î ¾Æ·¡¿Í °°´Ù.

URL typeProtocol¿¹Á¦
Navigator info about: about:cache
File file:/ file:///javascript/methods.html
FTP ftp: ftp://ftp.mine.com/home/mine
Gopher gopher: gopher.myhost.com
World Wide Web http: http://home.netscape.com/
JavaScript code javascript: javascript:history.go(-1)
MailTo mailto: mailto:info@netscape.com
Usenet news: news://news.scruznet.com/comp.lang.javascript
Navigator source viewer view-source: view-source:wysiwyg://0/file:/c|/temp/genhtml.html
Ư±â

protocol ¼Ó¼ºÀº Á¤º¸¸¦ È£½ºÆ®¿¡¼­ »ç¿ëÀÚ¿¡°Ô ¾î¶»°Ô ¼Û½ÅÇϴ°¡¸¦ Á¤ÀÇÇÑ´Ù.
http¿Í ftp protocolÀÌ °¡Àå ¸¹ÀÌ »ç¿ëµÇ°í ºê¶ó¿ìÀú´Â ´Ù¸¥ ¹Ì¸® Á¤ÀÇµÈ ÇÁ·ÎÅäÄݵéÀ» Áö¿øÇÑ´Ù.

document, img¿Í location °³Ã¼¿¡¼­´Â protocol ¼Ó¼ºÀÌ ÀбâÀü¿ëÀÌ´Ù.

location.protocol ¼Ó¼ºÀº ÁÖ¼ÒÀÇ ¾ÕÂÊ ¹®ÀÚ¿­À» ù¹ø° ÄÝ·Ð(:)±îÁö¸¦ Æ÷ÇÔÇÏ¿© ¹ÝȯÇÑ´Ù.(¿¹: http:).
¹Ý¸é document.protocolÀº ÇÁ·ÎÅäÄÝ ¾à¾î¸¦ ¹ÝȯÇÑ´Ù.(¿¹: Hypertext Transfer ProtocolÀ» http·Î)

protocol ¼Ó¼ºÀº ¾ðÁ¦³ª ¼³Á¤ÀÌ °¡´ÉÇÏÁö¸¸, href ¼Ó¼ºÀ¸·Î ¿¬°áÀ» »õ·Î ¼³Á¤ÇÏ¿© »ç¿ëÇÏ´Â °ÍÀÌ ¾ÈÀüÇÏ´Ù.

Àû¿ë
°³Ã¼scriptHTML±Ô°ÝIE


°£´ÜÇÑ protocol ¼Ó¼º ¿¹Á¦

trio °Ô½ÃÆÇ
<A href="http://trio.co.kr/cgi/bbs/triobbs.cgi?db=triobbs">trio °Ô½ÃÆÇ</A><BR>
<SCRIPT>
for (i=0;i<document.links.length;i++){
  if(document.links[i].hostname=='trio.co.kr')
    document.write(document.links[i].href+'<BR><FONT color=blue>'+document.links[i].protocol+'</FONT><BR>');
}
</SCRIPT>

´Ù¸¥ protocol ¼Ó¼º ¿¹Á¦

<SCRIPT>
document.write('document.location.protocol=<FONT color=blue>'+document.location.protocol+'</FONT><BR>');
document.write('location.protocol=<FONT color=blue>'+location.protocol+'</FONT><BR>');
document.write('document.protocol=<FONT color=blue>'+document.protocol+'</FONT><BR>');
</SCRIPT>

ÇöÀç ÆäÀÌÁöÀÇ ¼Ó¼º ¸ðµÎ º¸±â ¿¹Á¦

°á°ú Ç¥½Ãâ
<SCRIPT>
function allProtocol(){
  allLinks=document.links;
  str='allLinks.length='+allLinks.length+'<BR>';
  for (i=0;i<ALLLINKS.length;i++){
    if (!allLinks[i].protocol) return;
    str+='allLinks['+i+'].protocol='+allLinks[i].protocol+'<BR>';
  }
  showA.innerHTML=str;
}
</SCRIPT>
<BUTTON onclick=allProtocol()>ÆäÀÌÁöÀÇ ÇÁ·ÎÅäÄÝ ¸ðµÎ º¸±â</BUTTON>
<DIV id=showA>°á°ú Ç¥½Ãâ</DIV>