Wednesday, September 10, 2008

How to get current URL using JavaScript

Simplest way to get the current browser URL using JavaScript is to use window.location.href
Look at the following code,


<script type="text/javascript">

var url = window.location.href;

document.write(url);

</script>


Get Free Sinhala IT Learning Videos Kuppiya.com

 Subscribe To My Blog

1 comment: