HTML DOM protocol Property
Definition and Usage
The protocol property sets or returns the protocol of the current URL.
Syntax
Example
Assume that the current URL is: http://example.com/test/test.htm#part2:
<html>
<body>
<script type="text/javascript">
document.write(location.protocol);
</script>
</body>
</html>
|
Output:
Try-It-Yourself Demos
Use the
protocol property of the location object
|