You can get the url of the current window using javascript.
var origin = window.location.origin;
var pathname = window.location.pathname;
var origin = window.location.protocol;
var port = window.location.port;
window.location.reload();
In this way you can get the url of the current window using javascript.
To get the current window url, use the below javascript:
var url = window.location.href;
The above javascript code gives the full url of the window.To get the current window url using jquery, use the below code:
var url = $(location).attr('href');
To get the origin of the url use the following javascript code:
To get the pathname use:
To get the current window protocol use:
To get the port number of the current window use:
To Reload the current page using javascript use:
In this way you can get the url of the current window using javascript.
For more posts regaring please visit : Javascript
No comments:
Post a Comment