Variable in HTML

F

Francis

Hope someone can help...

I have the following:

<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<script language="JavaScript" src="http://MY_WEB_SITE/Address.js"> </script> (Address.js CONTAINS AN IP ADDRESS)
</head>

<body stylesrc="StartPage.htm">

<p align="center"><font size="7">Test Webcam</font></p>
<p align="center">


<applet width="240" height="160" code="JavaCamPush.class" archive="JavaCamPush.jar" codebase="http://xx.xx.xxx.xxx:30000/applet/">
<param name="cabbase" value="JavaCamPush.cab">
<param name="URL" value="http://" + IP_ADDR + ":30000"> (PROBLEM HERE!)
</applet>


I have used the IP_ADDR variable in another type of code from another page...

Example:

<script type="text/javascript">
location.href = 'http://' + IP_ADDR + ':33333/Online.htm';
</script>
The above works, as in the webpage it automatically redirects the user to the ONLINE.HTM webpage. I tried using something similar with the first example so the IP address automatically inserts itself in the java app for a website that has a dynamic IP address. The java app doesn't like me trying to add the "http://" to IP_ADDR and then the ":30000" port number.

Is there a way to get value="http://" + IP_ADDR + ":30000"> to work so that the java app sees value="http://xx.xx.xxx.xxx:30000" ?


- Francis
(P.S. Sorry for the HTML format of this post.)
 
J

Jon

Hi Francis,
you would need to write out the param line, eg
<param name="cabbase" value="JavaCamPush.cab">
<script type="text/javascript">
document.write('<param name="URL" value="http://" ' + IP_ADDR + '":30000">')
</script>
</applet>

Jon
Microsoft MVP - FP

Hope someone can help...

I have the following:

<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<script language="JavaScript" src="http://MY_WEB_SITE/Address.js"> </script> (Address.js CONTAINS AN IP ADDRESS)
</head>

<body stylesrc="StartPage.htm">

<p align="center"><font size="7">Test Webcam</font></p>
<p align="center">


<applet width="240" height="160" code="JavaCamPush.class" archive="JavaCamPush.jar" codebase="http://xx.xx.xxx.xxx:30000/applet/">
<param name="cabbase" value="JavaCamPush.cab">
<param name="URL" value="http://" + IP_ADDR + ":30000"> (PROBLEM HERE!)
</applet>


I have used the IP_ADDR variable in another type of code from another page...

Example:

<script type="text/javascript">
location.href = 'http://' + IP_ADDR + ':33333/Online.htm';
</script>
The above works, as in the webpage it automatically redirects the user to the ONLINE.HTM webpage. I tried using something similar with the first example so the IP address automatically inserts itself in the java app for a website that has a dynamic IP address. The java app doesn't like me trying to add the "http://" to IP_ADDR and then the ":30000" port number.

Is there a way to get value="http://" + IP_ADDR + ":30000"> to work so that the java app sees value="http://xx.xx.xxx.xxx:30000" ?


- Francis
(P.S. Sorry for the HTML format of this post.)
 
F

Francis

Thanks for the reply... but a problem still exists. I tried your suggestion and the Java app says the was no URL supplied. Thinking that the IP address wasn't passed to IP_ADDR, I removed that part and set up the following:

<applet width="240" height="160" code="JavaCamPush.class" archive="JavaCamPush.jar" codebase="http://xx.xx.xxx.xxx:30000/applet/">
<param name="cabbase" value="JavaCamPush.cab">
<script type="text/javascript"> document.write('<param name="URL" value="http://xx.xx.xxx.xxx:30000">') </script>
</applet>


The Java app still spits back an error about the URL. I further changed the code as such:

<applet width="240" height="160" code="JavaCamPush.class" archive="JavaCamPush.jar" codebase="http://xx.xx.xxx.xxx:30000/applet/">
<param name="cabbase" value="JavaCamPush.cab">
<param name="URL" value="http://xx.xx.xxx.xxx:30000">
</applet>


.... which works fine. Stripping out the javascript extras allows the URL to be read properly. To me the problem is in the document.write you suggested, or I'm missing something fundamental the script I wrote.

- Francis
( For years I've always said, "The bigger the problem, the smaller the solution.")


Hi Francis,
you would need to write out the param line, eg
<param name="cabbase" value="JavaCamPush.cab">
<script type="text/javascript">
document.write('<param name="URL" value="http://" ' + IP_ADDR + '":30000">')
</script>
</applet>

Jon
Microsoft MVP - FP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top