Solved

Opening multiple details pages in frames?!?!

Posted on 2003-11-07
8
227 Views
Last Modified: 2010-04-25
Hey there,

I have three frames. Frame 1 has a menu, when a item in the menu is clicked frame 2 displays a details page. Now this is fine but how do i make frame 3 open another details page using the same URL parameter when a menu item in frame one is clicked.

Basicly i need two seperate details pages to open in two seperate frames with one click.. Any ideas?

Nugs
0
Comment
Question by:Nugs
  • 4
  • 3
8 Comments
 
LVL 23

Expert Comment

by:Saqib Khan
ID: 9703503
<a href="javaScript:top.frames[1].location='abc.html';top.frames[2].location='klm.html'"> Update Two Frames </a>
0
 
LVL 8

Expert Comment

by:klykken
ID: 9703510
Hi Nugs,
You will have to use javascript to help yuo with this.

This is the javascript:

<script language="JavaScript"><!--
function functionName(fileName1,fileName2) {
    parent.frameName1.location.href = fileName1;
    parent.frameName2.location.href = fileName2;
}
//--></script>

And your link will have to look like this:

<a href="javascript:functionname('file1.html','file2.html')">Link</a>

If you need any more help with implementing this code, let me know!

-klykken
0
 
LVL 2

Author Comment

by:Nugs
ID: 9704482
klykken,

I implemented the code that you provided, with not much success. I'm getting an expected ")" when i run a debugger on it. Take a look at the code as i have it now. I also need not only to open two pages in two frames but pass a URL parameter to these frames.

So here is the code:

...
<script language="JavaScript"><!--
function TwoFrame(main.asp,right.asp) {
    parent.Mainframe.location.href = main.asp;
    parent.Rightframe.location.href = right.asp;
}
//--></script>
...
<a href="javascript:TwoFrame('main.asp','right.asp')"><img src="<%=(SectionSlides.Fields.Item("SectionSlide").Value)%>" border="0"></a>
...


here is the code used to open the details page in the 'main' frame that works using the 'Go To Details Page' server behavior:
...
<A HREF="main.asp?<%= Server.HTMLEncode(MM_keepURL) & MM_joinChar(MM_keepURL) & "ProjCode=" & SectionSlides.Fields.Item("ProjCode").Value %>" target="mainFrame"><img src="<%=(SectionSlides.Fields.Item("SectionSlide").Value)%>" border="0"></a>
...

All i need now is for the right.asp page to send the same URL param' something like the below code and then basicly combine the two so that both the mainFrame and rightFrame open there respective pages with the same URL param':

<A HREF="right.asp?<%= Server.HTMLEncode(MM_keepURL) & MM_joinChar(MM_keepURL) & "ProjCode=" & SectionSlides.Fields.Item("ProjCode").Value %>" target="rightFrame"><img src="<%=(SectionSlides.Fields.Item("SectionSlide").Value)%>" border="0"></a>

Any more help you can give me in figuring this out would be awesome.
Nugs
0
Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

 
LVL 2

Author Comment

by:Nugs
ID: 9704486
PS: it was this line that was giving me the error:

function TwoFrame(main.asp,right.asp)
0
 
LVL 8

Accepted Solution

by:
klykken earned 20 total points
ID: 9704599
You cannot have a dot in the function like that. (main.asp,right.asp) I think you mistakenly changed the function in the javascript because you thought the 'fileName1' should be replaced by the name of your file, it doesn't :-)

So use this instead:

<script language="JavaScript"><!--
function TwoFrame(fileName1,fileName2) {
    parent.Mainframe.location.href = fileName1;
    parent.Rightframe.location.href = fileName2;
}
//--></script>

<a href="javascript:functionname('main.asp','right.asp')">Link</a>

-klykken
0
 
LVL 8

Expert Comment

by:klykken
ID: 9704677
You could also use a much easier version like this:

<a href="main.asp" target="mainFrame" onClick="parent.rightFrame.location='right.asp'">Link</a>

Not sure why I didn't think of that right away... Much easier and intuitive..

-klykken




0
 
LVL 2

Author Comment

by:Nugs
ID: 9704723
Ok, that makes sence... but where in this code does it pass the URL param' for the selected record?
0
 
LVL 2

Author Comment

by:Nugs
ID: 9704770
Oh my bad, sometime i ask questions before i try to answer them myself. The link would look something liek this to pass the URL param' :

<a href="javascript:TwoFrame('main.asp?projCode=<%=(SectionSlides.Fields.Item("ProjCode").Value)%>','right.asp?projCode=<%=(SectionSlides.Fields.Item("ProjCode").Value)%>')"><img src="<%=(SectionSlides.Fields.Item("SectionSlide").Value)%>" border="0"></a>

There are still some fine tuning to do but i have run out of time, i have to leave but will be back tonight to let you know if i got it working ok, and if not then to get some more help from ya if you willing and  finaly to award some points.

Thanks again
Nugs
0

Featured Post

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Footer only sticks to bottom of browser with absolute positioning 13 321
Dreamweaver CS5.5 Error 5 537
Dreamweaver not "Putting" files to server 15 605
Website Design 13 121
For those who don't know, Adobe Dreamweaver is a popular commercial web editor that enables you to design, build and manage complex websites. The editor is a WYSIWYG (What You See Is What You Get) web editor, which means that you can create your web…
This article is very specific and is only intended to help if you are installing Dreamweaver 8 in a Windows 7 environment with Office 2007 installed.   I'm not sure why Microsoft tends to release OS' that should not be released but they do.  Windows…
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…

776 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question