Get URL Paramaeters if u r using internal script or referenced script

var url = new URL(‘https://sample.com?a=1&b=2&c=3’).searchParams;
params.get(‘a’); // “1”
params.get(‘b’); // “2”
params.get(‘c’); // “3”

or

var param1=location.search.split(‘a=’)[1]
var param2=location.search.split(‘b=’)[1]
var param3=location.search.split(‘c=’)[1]

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s