Daily Archives: 2015-09-22

Archive of posts published in the specified Day

Sep
22

Get page url in jquery

Paste this code in html body: <a href=”#detail” onclick=”CallUrl();”>Click to get url</a> Now start scripting 1. Add jquery library file <script src=”//ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js”></script> 2. paste the following code in script tag as below: <script> // function definition function CallUrl(){ var pageURL = $(location).attr(“href”); alert(pageURL);…