Horje
jquery get current url Code Example
jquery get current url
var currentURL = $(location).attr('href'); //jQuery solution
var currentURL = window.location.href; // raw javascript
jquery get url
var currentURL = $(location).attr('href'); 
var currentURL = window.location.href;
jquery get URL slug
var pathname = window.location.pathname;
JQuerry Get Url
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>jQuery Get Current Page URL</title>
<script src="https://code.jquery.com/jquery-1.12.4.min.js"></script>
<script type="text/javascript">
    $(document).ready(function(){
        $("button").click(function(){
            var currentURL=location.protocol + '//' + location.host + location.pathname;
  			alert(currentURL);
        });
    });
</script>
</head>
<body>
    <button type="button">Get URL</button>
</body>
</html>




Javascript

Related
jquery redirect Code Example jquery redirect Code Example
recuperar url javascript Code Example recuperar url javascript Code Example
How do I redirect to another webpage? Code Example How do I redirect to another webpage? Code Example
media query js Code Example media query js Code Example
Consider using '--resolveJsonModule Code Example Consider using '--resolveJsonModule Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
13