Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

jquery get url

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

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>
Comment

PREVIOUS NEXT
Code Example
Javascript :: Example: Export a Variable in Node 
Javascript :: exec reges 
Javascript :: Find the Missing Number js 
Javascript :: js push array to array 
Javascript :: javaScript getDay() Method 
Javascript :: path.join nodejs 
Javascript :: change the value in checkbox by button react 
Javascript :: count object in array javascript 
Javascript :: Error: "line" is not a registered controller 
Javascript :: Svg as a component react 
Javascript :: javascript require 
Javascript :: immediately invoked function expression 
Javascript :: js binary search 
Javascript :: delete a label jquer 
Javascript :: vue copy image to clipboard 
Javascript :: jquery number format thousand k 
Javascript :: how to get url parameter using jquery or plain javascript 
Javascript :: how to concat nested array in javascript 
Javascript :: anagram checker javascript 
Javascript :: ipcrenderer main.js 
Javascript :: list keys json python 
Javascript :: how to compare arrays in js 
Javascript :: javascript get client page title 
Javascript :: nuxt plugin 
Javascript :: remove element onclick javascript 
Javascript :: find items from array of ids mongoose 
Javascript :: remove specific item from array 
Javascript :: css vw not working on mobile 
Javascript :: link to website electron 
Javascript :: deploy react app 
ADD CONTENT
Topic
Content
Source link
Name
4+8 =