I want to generate the Base64 encoded token using jquery plugins.
function make_base_auth(username, password) {
console.log("Generating Base64 token");
var token = username + ':' + password;
var hash = $.base64.encode(token);
base_auth = "Basic " + hash;
return base_auth;
}
I have downloaded the plugin from below url. but its not working.
https://github.com/yatt/jquery.base64
I got the below error
TypeError: $.base64 is undefined
I am using jquery1.8.2, Jquery-mobile-1.1.1
Please help me out on this .
Did you make sure to include the script after including the jQuery script?