@manhng

Welcome to my blog!

Encrypt Query String Javascript

May 27, 2019 09:41

Encrypt Query String Javascript (edit)

Mã hóa Query String trên URL

var params = {width:1680, height:1050};

var str = jQuery.param(params);

console.log(str);

console.log(btoa(str)); // => d2lkdGg9MTY4MCZoZWlnaHQ9MTA1MA==

console.log(atob("d2lkdGg9MTY4MCZoZWlnaHQ9MTA1MA=="));

Tham khảo thêm

btoa: Binary to ASCII
atob: ASCII to Binary

https://developer.mozilla.org/ru/docs/Web/API/WindowBase64/Base64_encoding_and_decoding

https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/atob

https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/btoa

http://paginaswebpublicidad.com/questions/47073/ma-hoa-mot-id-trong-mot-url-trong-asp-net-mvc

You can access IE8 script console by launching the "Developer Tools" (F12). Click the "Script" tab, then click "Console" on the right.

From within your JavaScript code, you can do any of the following:

<script type="text/javascript">
    console.log('some msg');
    console.info('information');
    console.warn('some warning');
    console.error('some error');
    console.assert(false, 'YOU FAIL');
</script>

Also, you can clear the Console by calling console.clear().

NOTE: It appears you must launch the Developer Tools first then refresh your page for this to work.

Categories

Recent posts