How would I encode a URL on home.htm to open another page (index1.htm) which contains an Iframe with name="test" and id="test" and load it with include1.htm or include2.htm which resides in the same directory as index1.htm.

------------------------
Example: (button 1 needs encoding)

home.htm -> button 1 -> links to index1.htm

Index1.htm -> iframe name and id="test"

iframe "test" -> displays one of two includes as defined by button 1 encoding

the only path you need to worry about setting is when you open the window for index1.htm. once index1.htm is open the browser will use the same directory for the include files, so all you have to do with the script is put the include file name in it. you can also pass a different variable value to the winOp() function to write from a different include file. such as winOp("2") to write include2.htm into the iframe.

I hope this is what you were looking for

dsirois1

10-29-2006, 03:43 PM

Thank you very much, I will play around with it.

dsirois1

10-29-2006, 04:07 PM

Which part do i edit to get it to open in the same window?

Also, which part tells which include # to use?

dsirois1

10-29-2006, 04:35 PM

Here is the code for the entire page. What am i doing wrong? I've placed the script in both the <body> and <head> positions.

ok, i see the problem after going to your test page. the problem is that the first script i gave you calls the setIframe() function right after it opens the new window. the problem with that is the page has to load and the iframe has to exsist before the setIframe() function starts running.(this becomes a hassle when the page does not load quickly). the below scripts should correct that problem.

this only works if the iframe is in a new window, not in the main page.

and to have a different include.htm loaded change the part within the button's tag that reads winOp('1'); to winOp('2'); where the number in quotes is the number of the include.htm file.

dsirois1

10-29-2006, 07:43 PM

You were right in that the page I am linking from also contains an Iframe which is also named "test". To avoid confusion I should have deleted it.

I'll clarify:
What I need to do is: While on index1.htm be able to click one of two (or more) links that define the variable (include) and load on top of itself, index2.htm to include the defined include1.htm or include2.htm.