Solved

HREF and two targets

Posted on 2004-04-29
5
639 Views
Last Modified: 2008-03-17
The following code snippet is from an events calendar that I've been working on for some time:

Write_TD "<A HREF=events.asp?date="& Server.URLEncode(dToday) & " CLASS='TODAY1' target='bottom'> " & intPrintDay & "</A>", "HL"

Question:
How do I add code that will allow HREF to target two frames instead of just one?

Currently, the HREF tag targets only the events.asp page.

I need HREF to target two pages ("events.asp" in an Iframe called "bottom" simultaneously with a page called "date.asp" in an Iframe called "middle").

Note:  CLASS='TODAY1' and "HL" are used in conjunction with an embedded CSS. The URLEncode string provides date information which when the link is clicked sends the date to the events.asp page.

I've already tried and failed using JavaScript with an "onClick" function, and I've tried the following code which only generates javascript errors:

<head>
<script language=javascript>
<!--
function go(p1,p2)
{
parent.frame1.location.href=p1;
parent.frame2.location.href=p2;
}
//-->
</script>
</head>

<body>

<a href=javascript:go('page1.asp','page2.asp')


Any help would be greatly appreciated.  
0
Comment
Question by:bapasba
5 Comments
 
LVL 12

Accepted Solution

by:
rcmb earned 63 total points
ID: 10954993
Try using javascript something like this

function openPages() {
window.frames[1].location=doc1.html
window.frames[2].location=doc2.html
}

<A href="javascript:openPages();">Link</A>

window.frames is an array of all the frames listed in the order that they are in the html document. Array index starts a 0.

In the above example I'm assuming the link is in the first frame and you want to change the second two frames.

RCMB
0
 
LVL 23

Assisted Solution

by:Saqib Khan
Saqib Khan earned 62 total points
ID: 10956184
or Try

top.frames[0].location = var_name
0

Featured Post

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

Suggested Solutions

I have helped a lot of people on EE with their coding sources and have enjoyed near about every minute of it. Sometimes it can get a little tedious but it is always a challenge and the one thing that I always say is:  The Exchange of information …
I would like to start this tip/trick by saying Thank You, to all who said that this could not be done, as it forced me to make sure that it could be accomplished. :) To start, I want to make sure everyone understands the importance of utilizing p…
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…

786 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