Get current url using JavaScript jQuery

Introduction:

In my previous article I have explained about how to run google apps script function periodically javascript. In this article I am going to explain about How to get current url in jquery,Javascript and C#.Net.
Explanation:
Get current url using jQuery

var currenturl = $(location).attr(‘href’);

In javascript

var currenturl = window.location.href;

In C#.net

string url = HttpContext.Current.Request.Url.AbsoluteUri;

Subscribe For Latest Updates

Signup for our newsletter and get notified when we publish new articles for free!