javascript - How to disable browser default password pop-up? -


  1. i developing google chrome plugin.
  2. under options page running ajax request server requires password
  3. 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

Popular posts from this blog

c++ - How do I get a multi line tooltip in MFC -

asp.net - In javascript how to find the height and width -

c# - DataTable to EnumerableRowCollection -