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

Popular posts from this blog

HTML/CSS - Automatically set height width from background image? -

php - Mysql Show Process - Sleep Commands and what to do -

c - What is the address of buf (the local variable in the main function)? -