Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 676
  • Last Modified:

HREF and two targets

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
bapasba
Asked:
bapasba
2 Solutions
 
rcmbCommented:
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
 
Saqib KhanSenior DeveloperCommented:
or Try

top.frames[0].location = var_name
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now