Making GET parameters not readable for users in Javascript

When you want to hide some URL parameters from users, there is a simple way how to do it. Be aware that more experienced users can read it anyway, so this is not a way how to send confidential data, just to make URL address not readable at first sight.

For this problem, we can use base64 encoding. There are functions in various programming languages for encoding and decoding base64.

In Javascript we can use following approach to encode and decode some string:

Instead of Hello world we will get string SGVsbG93IHdvcmxk.

To sum up, we send our parameters in one GET parameter in appropriate format such as JSON and encoded as base64. In Javascript, we decode base64, explode parameters into variables and we are done.


Peter Marcely

ABAP, Python, JavaScript developer