passing parameters from a frameset

liunx

Guest
okay, I know that framesets are bad, but i have no choice.<br />
<br />
we have a graphic interface program which had been adapted for web browsing using java applets.<br />
<br />
when a new picture is required, the following request for a template file is made:<br />
<br />
template.html?applet_name.ext<br />
<br />
the template file resolves the type of applet (there are three) and opens it in another page.<br />
<br />
for reasons of design (everything on one page should fit in the screen area), we are limiting the actual area of the graphic to fit on one screen. unfortunately, we would have to mess around with scroll-bars in most cases.<br />
<br />
that is why I am using the frameset - and setting NORESIZE and SCROLLING=0.<br />
<br />
<br />
<b>the problem</b><br />
<br />
i tried to source the framne like this:<br />
<br />
src=http://www.htmlforums.com/archive/index.php/"template.html?applet_name.ext"<br />
<br />
where "applet_name.ext" is passed as an argument to the frameset file.<br />
<br />
but the argument is not passed - is there a reason for this and how do I fix it?<!--content-->Passing variables to the url of the individual frames are possible and will work just fine.<br />
<br />
However, the page you are transferring it to (template.html) must know how to parse it. Normally you would have a page setup to handle some server side scripts, such as template.php, template.asp, template.pl and the language intrepeter on the server would know what to do with appended variables.<br />
<br />
However, does your template.html page know what to do with the passed variables ?<br />
<br />
You can extract the search string parameters using javascript if you like, but more relevantly ask yourself how does the applet get the information in a non-frames page..?<br />
<br />
To test that variables are indeed being passed try this in the 'template.html' frame:<br />
<br />
<script language="javascript"><br />
<!--<br />
function show(){<br />
alert(self.location.search);<br />
}<br />
self.onload=show;<br />
//--><br />
</script><br />
<br />
It should give the alert message with the ? and everything following when the frame page has loaded.<!--content-->Thanks kd, that reply helped pretty good.<br />
<br />
here's the solution I used:<br />
<br />
<br />
<HTML><br />
<HEAD><br />
<br />
<TITLE>Wizcon Application</TITLE><br />
<br />
<script language="javascript"><br />
<br />
function openApplet()<br />
{<br />
var applet_name = self.location.search;<br />
<br />
document.writeln("<html>");<br />
document.writeln("<head>");<br />
document.writeln("</head>");<br />
<br />
document.writeln("<frameset rows='100%'>");<br />
<br />
document.writeln("<frame src='http://www.htmlforums.com/archive/index.php/template2.html" + applet_name + "' scrolling='no' noresize");<br />
<br />
document.writeln("</frameset>");<br />
document.writeln("</html>");<br />
}<br />
<br />
</script><br />
<br />
</HEAD><br />
<br />
<body onLoad=openApplet()><br />
</body><br />
<br />
</HTML><br />
<br />
<br />
this then passes the parameters over to the original file which handles the problem of opening the applet.<!--content-->
 
Back
Top