I am trying to be able to pass a parameter in my URL to a subpage that
will load the file specified in the paramater into an IFRAME. I have
hardly used Javascript, and am trying to figure out how I would do
this. My URL should always look like this:
http://www.xxx.com/newsite/subpage.h...=filename.html
The javascript I came up with looks like this, because I will only have
one parameter and I know that with the ? and the = that the length of
the param name will always be 6.:
<SCRIPT language="JavaS cript" type="text/javascript">
function GetDocName() {
var
SearchStr, // Search String
DocName, // Name of Document to Use
NameLen; // Length of Document Name
SearchStr = location.search ;
NameLen = SearchStr.Lengt h;
DocName = "documents/"+SearchStr.Sub string(7,NameLe n);
}
return DocName;
</SCRIPT>
What I don't know is how to get the results of the function into my
Iframe. This is what I have tried, with no luck:
<IFRAME height="600" width="780" scrolling="auto "
src="javascript :parent.GetDocN ame()"></IFRAME>
Any help with this would greatly be appreciated!
Ralph