Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I open page with another page loaded in frame

Status
Not open for further replies.

stressball

Programmer
Mar 14, 2001
68
AU
Hi,

I have 2 pages. The first page has a link to the second page, which is fine, but when the user clicks on the link I need the second page to open with a .htm also loading in the main frame of the second page.

Your help would be greatly appreciated.
 
Sorry, could you explain with some code or more carefully, please!
I do not understand what you want it to do.
 
Let's say your main page has 3 frames like so:
<frame id=&quot;topnav&quot; src=&quot;topnav.asp&quot; scrolling=&quot;no&quot;>
<frame id=&quot;search&quot; name=&quot;search&quot; src=&quot;Search.asp&quot; scrolling=&quot;auto&quot;>
<frame id=&quot;results&quot; name=&quot;results&quot; src=&quot;Results.asp?status=blanc&quot;>

to display another htm page in the results frame you can use the following line(only IE):
document.all.item(&quot;rsults&quot;).src=&quot;myNewUrl.htm&quot;
 
ok but there's a very simple, standard (meaning : actually cross browser) solution in plain html
<a href=mynewurl.htm target=rsults>go to</a>
it is not elegant neither safe to use fancy javascript when there are plenty of plain html solutions
 
Yes but if your page is a little bit more dynamic you might need some script like so:
document.all.item(&quot;rsults&quot; + myCounter).src=&quot;myNewUrl.asp?ID=&quot; + myCounter

I used it in several of my IIS application and got no problems with it yet (everybody uses IE so I got lazy checking the Netscape side of it)

Setting a target in the <form> tag can allso give wonderfully confusing results if the form is not submitted but a popup is called (the target starts showing something when it shoudn't) So I am used to set as many values by script to prevent unexpected things from happening.
 
iza

Thanks for your reply, I would like to get this working using just HTML, but what you said does not work.
When the user clicks on the button on the first page I need the second frameset.htm to open, when that frameset opens, I need index.htm to be visible in the main frame.

<a href=&quot;pages/page_frameset.htm&quot; -(the frame set to load)
target=&quot;pages/test.htm#mainFrame&quot; -(the page to load in main)
</a>

This does not work, it displays the frameset, but main is empty.

Your help would be most appreciated :)
 
i replied in the other thread you've started. It's very confusing if ou start 2 threads for the same question.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top