JavaScript Reference/Javascript Properties/protocol

Материал из Web эксперт
Перейти к: навигация, поиск

"protocol" Example

    
<html>
<body>
<script language="JavaScript">
function function1() {
   alert(document.getElementById("myA").protocol);
}
</script>
<a id="myA" href="http://www.wbex.ru" target="_blank">wbex.ru home page</a>
<input type="Button" id="myB" value="Protocol" onClick="function1();">
</body>
</html>



"protocol" is applied to

+----------------+--------------------------------------------------------------+
| Applied_To     |<a>                             <area>                        |
|                |document                        <img>                         |
|                |location                                                      |
+----------------+--------------------------------------------------------------+



"protocol" Syntax and Note

Note:
Read and write property. 
Sets the URL protocol part.
    
Syntax:
    
document.getElementById("elementID").protocol = value
document.all.elementID.protocol = value // IE only
objectName.protocol