Make a hidden field and put the vale in it as like below example, then get the value using jQuery selector. As an Example, MVC View Code looks like this, < input type = 'hidden' value = '@Request.QueryString["token"]' id = 'hdnToken' /> JavaScript code looks like this, $ ( function () { var token = $ ( "#hdnToken" ). val (); console . log ( token ); }); Another Example, //You can use URLSearchParams which is simple . var getURLSearchParams = function ( parameterName ) { var result = null , tmp = []; location . search . substr ( 1 ) ...
Angular, React, JavaScript, Java, PHP, SQL, C#, Vue, NodeJs, TypeScript and Interview Questions Answers