Hi all! I did a search and didn't come up with an answer. I am not well versed in js, but I believe it is the best method for what I am trying to accomplish. I have an image I would like to display on a webpage. This image is a snapshot from our company web camera (IP webcam). The problem is, the webcam is running it's own webserver which requires basic authentication in order to view the image. What I want to be able to do is pass the authentication when my webpage loads, so that I may use the URL to the image in the html of the webpage. I was trying to accomplish this with js, but as you'll see from my code, I don't really know what I am doing. I have been on the net for hours trying to figure out what I am missing, but to no avail. It seems like it must be something simple. I appreciate any and all feedback.
PP
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>Webcam Snapshot</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<META http-equiv="Pragma" CONTENT="no-cache">
<META HTTP-EQUIV="Cache-Control" CONTENT="no-cache">
<script language="JavaScript" type="text/javascript">
function getText2( )
{
// HttpRequest SetCredentials flags
HTTPREQUEST_SETCREDENTIALS_FOR_SERVER = 0;
// Specify the target resource.
WinHttpReq.open( "GET",
" false );
// Set credentials for server.
WinHttpReq.SetCredentials( "username",
"password",
HTTPREQUEST_SETCREDENTIALS_FOR_SERVER);
WinHttpReq.send( );
};
</script>
</head>
<body onLoad="javascript:getText2()">
<img src="</body>
</html>
PP
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>Webcam Snapshot</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<META http-equiv="Pragma" CONTENT="no-cache">
<META HTTP-EQUIV="Cache-Control" CONTENT="no-cache">
<script language="JavaScript" type="text/javascript">
function getText2( )
{
// HttpRequest SetCredentials flags
HTTPREQUEST_SETCREDENTIALS_FOR_SERVER = 0;
// Specify the target resource.
WinHttpReq.open( "GET",
" false );
// Set credentials for server.
WinHttpReq.SetCredentials( "username",
"password",
HTTPREQUEST_SETCREDENTIALS_FOR_SERVER);
WinHttpReq.send( );
};
</script>
</head>
<body onLoad="javascript:getText2()">
<img src="</body>
</html>