html - Authentication required? javascript -


i wondering how can require authentication website. such in picture: https://kb.tanium.com/images/thumb/5/58/authenticationrequired.png/700px-authenticationrequired.png

can javascipt? help

that's basic http response code 401 sent browser upon request. can on webserver securing folder/page .htaccess file or directive, or can return 401 http response in code (java, php or whatever use) example in java:

response.setstatus(httpservletresponse.sc_unauthorized); 

normally handle of 401 responses job of browser, has nothing javascript. can try change defaut behavior of browser using javascript, try take @ page. i'd recommend not doing instead html form can freely customize , let return form identifiers.


Comments

Popular posts from this blog

mysql - FireDac error 314 - but DLLs are in program directory -

git - How to list all releases of public repository with GitHub API V3 -

c++ - Getting C2512 "no default constructor" for `ClassA` error on the first parentheses of constructor for `ClassB`? -