TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Shristy Shrivastava
NA
45
2.5k
Encode query string in url
Nov 14 2018 3:51 AM
window.
btoa
(str); // for encoding any string
window.
atob
(enc); // for decoding any encoded string
on 1st page, where we pas query string
var qstring = "&projectname=" + window.btoa(projectData[t][1].v) + "&account=" + window.btoa(projectData[t][4].v) + "&pcode=" + window.btoa(projectData[t][0].v) + "&ced=" + window.btoa(projectData[t][13].fv) + "&pract=" + window.btoa(projectData[t][9].v) ;
var link = "[site url]" + qstring;
on 2nd page, where query string variable is fetched
//First we must call the EnsureSetup method
JSRequest.EnsureSetup();
//Get a query string parameter called Id. i.e - "page.aspx?Id=11" will return 11
var account = JSRequest.QueryString["account"];
var projectName = JSRequest.QueryString["projectname"];
var contractEndDate = JSRequest.QueryString["ced"];
var pcode = JSRequest.QueryString["pcode"];
var pract = JSRequest.QueryString["pract"];
var acnt = window.atob(account);
var pName = window.atob(projectName);
var pCode = window.atob(pcode);
var ced = window.atob(contractEndDate);
var practice = window.atob(pract);
Reply
Answers (
1
)
Export Arabic HTML to PDF using javascript
Difference between single and double quotes in Javascript?