jquery - How to append Authorization in an URL? -
I might have a very old question, but ask if I have URL like $ http: //www.test Com $
and I would like to, in jQuery, the url to add authorization (username: password), URL to $ http: // username: password @ Www.test.com should be $
How do I complete it?
You can do it like this:
$ Ajax ({type: 'GET', url: ..., Username: 'Username', Password: 'Password', Preceded: Function (Excerpt) {var base64 = $ .base64.encode ('Username' ": '+' Password '); xhr.setRequestHeader (" authorization "," basic "+ base 64);}, error: function ..., success: function ...
});
This
Comments
Post a Comment