|
-
Nov 15th, 2000, 11:20 AM
#1
Thread Starter
New Member
Does anyone know if it is possible to use a variable to place the URL into a hyperlink. Or is there a better way?
Thanks
Craig
-
Nov 15th, 2000, 03:00 PM
#2
Frenzied Member
it should be possible, what are you trying to do?
-
Nov 15th, 2000, 06:08 PM
#3
Thread Starter
New Member
I have a page with two frames. the main frame contains a body of text. This frame also contains a line of code giving the variable the name of the next file to be loaded. The second frame contains a navigation set of buttons. I want the 'next' button for example to use the variable value as the hyperlinks and load it it the 'main' frame.
Each page that load into the main frame would contain a line with a new value for the variable.
-
Nov 15th, 2000, 10:50 PM
#4
This what you want?
Code:
<SCRIPT LANGUAGE="JavaScript">
function change(newDes) {
window.location=newDes
}
</SCRIPT>
<input type="button" value="Click" onClick="change('http://www.vb-world.net')">
-
Nov 16th, 2000, 03:32 AM
#5
Frenzied Member
is this the sort of thing that you require?
frames page:
Code:
<HTML>
<frameset cols="100,*">
<frame name="left" src="./cwleft.html">
<frame name="main" src="./cwpage1.html">
</frameset>
</HTML>
cwleft.html:
Code:
<HTML>
<HEAD>
<script language=javascript>
function doit()
{
parent.main.location=parent.main.nextPage;
}
</script>
</HEAD>
<BODY>
<form>
<input type="button" value="next" onClick="doit()">
</form>
</BODY>
</HTML>
cwpage1.html:
Code:
<HTML>
<HEAD>
<script language=javascript>
var nextPage="./cwpage2.html";
</script>
</HEAD>
<BODY>
<h4> this is page1 </h4>
</BODY>
</HTML>
cwpage2.html:
Code:
<HTML>
<HEAD>
<script language=javascript>
var nextPage="./cwpage1.html";
</script>
</HEAD>
<BODY>
<h4> this is page2 </h4>
</BODY>
</HTML>
-
Nov 16th, 2000, 05:35 AM
#6
Thread Starter
New Member
Thank you very much for that. I didn't even think about going down the form route. Daft really.
Thanks again it works a treat.
Craig
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|