“jQuery obtient une URL” Réponses codées

jQuery obtenir l'URL actuelle

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

jQuery obtient une URL

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

jquery obtient une limace d'url

var pathname = window.location.pathname;
Carnivorous Flamingo

JQuerry obtient 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

Réponses similaires à “jQuery obtient une URL”

Questions similaires à “jQuery obtient une URL”

Plus de réponses similaires à “jQuery obtient une URL” dans JavaScript

Parcourir les réponses de code populaires par langue

Parcourir d'autres langages de code