window.location.href
PropertyYou can use the JavaScript window.location.href
property to get the entire URL of the current page which includes host name, query string, fragment identifier, etc.
The following example will display the current url of the page on click of the button.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Get Current URL in JavaScript</title>
</head>
<body>
<script>
function getURL() {
alert("The URL of this page is: " + window.location.href);
}
</script>
<button type="button" onclick="getURL();">Get Page URL</button>
</body>
</html>
Hi, My name is Harsukh Makwana. i have been work with many programming language like php, python, javascript, node, react, anguler, etc.. since last 5 year. if you have any issue or want me hire then contact me on [email protected]
Create custom error page in Laravel 8
Laravel provides with default all errors...Method Tymon\JWTAuth\Commands\JWTGenerateCommand::handle() does not exist
Today, we are install laravel 5.5 and in...How to Create Custom Blade Directive in Laravel
Laravel blade is simple template engine...Laravel Eloquent Has Many Through Relationship Tutorial with Example
Laravel provides eloquent relationship w...How to animate div height on mouse hover using jQuery
Use the jQuery animate() metho...