PDA

View Full Version : how to!! urgent!


yoshikev
03-27-2004, 12:05 PM
Anyone know how to make a link target to a layer instead of a frame?
i really to know

missing-score
03-27-2004, 12:29 PM
Hi, please read the posting guidelines: <http://www.codingforums.com/postguide.htm>

As far as your question, i dont think that it can be done unless you have some sort of script setup.

Roy Sinclair
03-27-2004, 04:04 PM
<a href="somepage.htm" target="frame name goes here">

Frames are troublesome though, why are you using them?

Nightfire
03-27-2004, 04:24 PM
Roy, he/she's wanting to point to a layer, not a frame. If that way works for layers too, then ignore me :)

Roy Sinclair
03-29-2004, 02:48 PM
Roy, he/she's wanting to point to a layer, not a frame. If that way works for layers too, then ignore me :)

I see that now, must've been blind last time round.

I think that what yoshikev means by "layer" had best be defined first since it seems there are a lot of different meanings.

Garadon
03-29-2004, 05:48 PM
don't think you can target layers(div,span,layer,etc..)

there are ways around it though:

you can put an iframe in a layer and target that.
you can load your content elsewhere and then drop it in the layer.

Willy Duitt
03-29-2004, 07:35 PM
Coothead, Agent002 and myself messed around with the idea of replacing a target page without using iframes and the below is what Agent002 came up with. If anyone can improve upon this to make it cross-browser and validate as XHTML 1.0 strict that would be great!

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Object Replacement Test</title>
<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=utf-8" />

<style type="text/css">
/*<![CDATA[*/
body
{
background-color:#aaaaff;
}
#one
{
position:absolute;
left:50%;
top:50%;
margin:-150px 0 0 -250px;
}
object
{
width:500px;
height:300px;
border:solid 1px #000000;
}
/*//]]>*/
</style>

<script type="text/javascript">
//<![CDATA[

function updateObjectIframe(which){
document.getElementById('one').innerHTML = '<'+'object id="foo" name="foo" type="text/html" data="'+which.href+'"><\/object>';
}

//]]>
</script>

</head>
<body>

<div id="one">
<object id="foo" name="foo" type="text/html" data="http://www.w3schools.com/"></object>
</div>
<div>
<a href="http://www.google.com" onclick="updateObjectIframe(this); return false;">this is an object test not an iframe test</a>
</div>

</body>
</html>

.....Willy