/    Sign up×
Community /Pin to ProfileBookmark

a little help with <a href> and functions

Good day folks,

I have posted some code here and I have a question as to which way is best or if what we want to do is possible.

This site I’m working on is done in frames, and here is a sample of our navigation menu code. Also the information that loads after a navigation option is picked comes from a database.

My question to you is:

Is it possible to use the <A href to not only load the menu but to also load a page in a different frame at the same time? If so or if not what would you suggest.

Thanks in advance.

<%@LANGUAGE=”VBSCRIPT”%>
<%Option Explicit%>

<%’set to no caching on client browser or proxy
response.expires=0
Response.CacheControl=”PUBLIC”
%>
<%
‘<!–#include file=”adovbs.inc”–>
‘<!–#include file=”vbutil.inc”–>

Dim NavMode,PMode,SMode,QMode,HMode,NMode,nSign’, strUA, textSize

‘strUA = Request.ServerVariables(“HTTP_USER_AGENT”)
‘if InStr( strUA, “MSIE”) Then
‘textSize = “xx-small;”
‘else
‘textSize = “x-small;”
‘end if

if session(“Wel”)=”1″ then
NavMode=””
end if
if session(“Wel”)=”2″ then
NavMode=”EXABOUTUS”
end if
if session(“Wel”)=”3″ then
NavMode=”EXCOURSES”
end if
if session(“Wel”)<>”1″ and session(“Wel”)<>”2″ and session(“Wel”)<>”3″ then
NavMode = Request.QueryString(“NavMode”)
PMode=request.querystring(“PMode”)
SMode=request.querystring(“SMode”)
end if
session(“Wel”)=”0″
NavMode=”EXCOURSES”

‘***************
‘* ‘Connection DECLARATION
‘***************
Dim strConn
Dim objConnection
Set objConnection = Server.CreateObject(“ADODB.Connection”)
strConn = “Provider=SQLOLEDB; Data Source=CLIENTELE; Initial Catalog=PCWeb; User ID=Web; Password=”
objConnection.Open strConn

%>
<html>
<head>
<link rel=”stylesheet” type=”text/css” href=”menu.css”>
<LINK REL=”SHORTCUT ICON” HREF=”portage.ico”>
<meta NAME=”GENERATOR” Content=”Microsoft FrontPage 5.0″>
<title>Portage College Menu</title>

</head>
<body>
<script type=”text/javascript” language=”JavaScript”></script>
<table border=”1″ cellpadding=”1″ cellspacing=”1″ align=”left” bordercolor=#ffffff width=’165′>
<tr>

<td>
&nbsp;
</td>
</tr>
<!– PROGRAMS –>
<%if NavMode = “EXCOURSES” Then%>
<tr >

<td onMouseOver=”id=’lightbg'” onMouseOut=”id=’darkbg'” >
<A href=”menu.asp?NavMode=EXCOURSES&amp;PMode=Acad”>Learning & Employment Foundations</A>
</td>
</tr>
<%IF PMode=”Acad” THEN
‘***********************
*
Academic Foundations MENU Recordset
**
*********************
‘Declare Recordset & Recordset object
Dim objAUProgram
Set objAUProgram = server.CreateObject(“ADODB.Recordset”)

‘Declare SQL statement and Open String
Dim strAUProgram
strAUProgram = “select distinct offering_desc, program_grp_id as program_grp_id, rtrim(program_id) as program_id from aemprogramoff where program_grp_id = ‘AU’ AND date_to >= getdate() and status = ‘N’ and program_id not like ’32’ and program_id not like’30’ order by offering_desc ASC”
objAUProgram.Open strAUProgram, objConnection

‘Check for Records
if objAUProgram.BOF or objAUProgram.EOF then
Response.Write “No Program available.”
else
‘Move Recordset to first record
objAUProgram.MoveFirst

‘****** NOTES *******”SHOW ‘OFFERING_DESC’ BUT HIDE PROGRAM_GRP_ID AND PROGRAM_ID
‘Want to bring in three columns, but just want to show one…this way I can use the other two variables
‘that I brought in to pass to the main asp page

DO WHILE NOT objAUProgram.EOF
%>
<tr><TD>&nbsp;-
<a href=”ProgDisplay.asp?pgi=<%=objAUProgram(“program_grp_id”)%> &pi=<%=objAUProgram(“program_id”)%> ” target=’Content’ onMouseOver= “id=’fontchange'”>
<%Response.Write objAUProgram(“offering_desc”)%></a></td></tr><%
‘Advance to next record in Recordset
objAUProgram.MoveNext
Loop
end if
END IF’PMode=”Acad”

%>
<tr>
<td onMouseOver= “id=’lightbg'” onMouseOut= “id=’darkbg'”>
<A href=”menu.asp?NavMode=EXCOURSES&amp;PMode=UniStud”>University Studies</A></td>
</tr>

to post a comment
JavaScript

1 Comments(s)

Copy linkTweet thisAlerts:
@phpnoviceApr 28.2006 — Is it possible to use the <A href to not only load the menu but to also load a page in a different frame at the same time?[/QUOTE]
Depends on whether the "frame" is a true frame or an iframe. The following is for a true frame:
[code=html]<a href="someurl" target="someframe" onclick="
top.frames['someotherframe'].location.href='someotherurl';
return true;">link text</a>[/code]
×

Success!

Help @BluGlass spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.19,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...