javascript - How to disable browser default password pop-up? -
- i developing google chrome plugin.
- under options page running ajax request server requires password
- i want catch error if password incorrect, browser giving popup window.
alt text http://img834.imageshack.us/img834/2905/browserproblem.png
can disable , how?
the problem you’re not base64-encoding username (i.e., authentication token) , (dummy) password you’re sending (which requirement of http basic authentication scheme). here’s code ought like:
var xhr = new xmlhttprequest(); xhr.open('get', 'http://onsip.highrisehq.com/account.xml'); xhr.setrequestheader('authorization', 'basic ' + btoa(token + ':')); xhr.onreadystatechange = function() { console.log(xhr.responsetext); }; xhr.send();
(i swapped in 'onsip'
subdomain you, still need replace token
authentication token.)
Comments
Post a Comment