Advertisement
briank

Kartra Escape Query

Aug 10th, 2021
1,579
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /*
  2.  * Kartra drops all but the first parameter (if any) and then adds
  3.  * r_done=1 on the first visit to a custom domain. This function
  4.  * encodes all the parameters into the first in a way that gets
  5.  * properly expanded to the original parameter list.
  6.  * Takes the original query string without the leading ?.
  7.  */
  8. function kartraEscapeQuery (qs) {
  9. return '?$=' + encodeURIComponent(encodeURIComponent('&' + qs)) + '&' + qs;
  10. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement