“jQuery obtenga URL actual” Código de respuesta

jQuery obtenga URL actual

var currentURL = $(location).attr('href'); //jQuery solution
var currentURL = window.location.href; // raw javascript
Grepper

jQuery obtenga URL

var currentURL = $(location).attr('href'); 
var currentURL = window.location.href;
Sid Potti

jQuery consigue una babosa de url

var pathname = window.location.pathname;
Carnivorous Flamingo

Jquerry obtenga 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>
Dizzy Donkey

Respuestas similares a “jQuery obtenga URL actual”

Preguntas similares a “jQuery obtenga URL actual”

Más respuestas relacionadas con “jQuery obtenga URL actual” en JavaScript

Explore las respuestas de código populares por idioma

Explorar otros lenguajes de código