You are here: irt.org | FAQ | JavaScript | Link | Q75 [ previous next ]
If you pass the stock name as a search parameter, i.e. append with a '?' then you can retrieve this information when creating the frameset. For example if the original form looked something like this:
<form name="formName" onSubmit="return displayURL(document.formName)"> <input type="text" name="urladdr" size="10"> </form> <script language="JavaScript"><!-- function displayURL(item) { urlWindow = window.open('','ReportWindow'); urlWindow.location.href = 'frame.html' + '?' + item.urladdr.value; return false; } //--></script>
Then the frame.html document could look like this:
<html> <script language="JavaScript"><!-- var parameter = location.search.substring(1); var url1 = "http://xxx.xxx.xxx/earnings/" + parameter; var url2 = "http://xxx.xxx.xxx/estimates/" + parameter; var url3 = "http://xxx.xxx.xxx/graphs/" + parameter; var url4 = "http://xxx.xxx.xxx/news/" + parameter; document.write('<frameset rows="50%,50%">'); document.write('<frameset cols="50%,50%">'); document.write('<frame src="' + url1 + '">'); document.write('<frame src="' + url2 + '">'); document.write('<\/frameset>'); document.write('<frameset cols="50%,50%">'); document.write('<frame src="' + url3 + '">'); document.write('<frame src="' + url4 + '">'); document.write('<\/frameset>'); document.write('<\/frameset>'); //--></script> </html>