Status 401 when using external Javascript, need a work around -
here facts. have html page calls external javascript file. when load page 401. understand 401 deals authentication, page i'm loading login page. need validate fields, js file not load won't validate fields.
does know causes? or work around?
what http401 unauthorized
error. javascript file resides in password-protected folder on server.
if need file in order operate login form, have bring out of protected folder.
in case file externally loaded (that is, not on server), can use xmlhttprequest
in order authenticate.
here example using jquery:
$.ajax({ url: /* url */, datatype: "script", username: /* username */, password /* password */: success: /* success callback function */ });
if not want expose username
and\or password
, i'd suggest storing js file locally on server without authentication.
Comments
Post a Comment