Thread: problem with linking a page
Results 1 to 6 of 6
Related
-
Linking iframes in different page? Forum: HTML Forum
Replies: 1 -
Linking within a page Forum: HTML Forum
Replies: 8 -
linking to the page you are on but a bit futher down Forum: HTML Forum
Replies: 1 -
page linking problem i believe Forum: HTML Forum
Replies: 14
-
06-04-2008, 04:27 PM #1
problem with linking a page
I am currently working on my first website, but I am stucked with a problem.
I am trying make a page open in a box (in a div) of my home page. Somehow, no matter what I do, my page will either not open at all, or open in a separate window. I am useing the "target" javascript command (the one that i found on the net.
Is that the right way to do it? Am I on the right path?
Or is it at least possible to open that window in a div?
-
06-04-2008, 11:47 PM #2
Re: problem with linking a page
You cannot do it using target attribute since it's use is for iframe.
You can either, use iframe for this one or use either these two:
innerHTML
firstChild.nodeValue
See if it helps.
-
06-06-2008, 05:29 PM #3
Re: problem with linking a page
How about posting your code for us????
-
06-06-2008, 10:12 PM #4
Re: problem with linking a page
This is what I'm stucked on right now:
<head>
<script>function photoopen()
{
document.getElementById('photos').innerHtml="2005.html";
}
</script>
</head>
<body>
<div id="side-bar">
<ul>
<li><a href="albums/2005.html" onClick="photoopen()";> 2005's album</a></li>
<li><a href="#" >2006's album</a></li>
<li><a href="#" >2007's album</a></li>
<li><a href="#" >2008's album</a></li>
</ul>
</div>
<div id="photos">
</div>
</body>
So, what I am trying to do, is to have another page (2005.html) open inside the #photos
And similar for the other links in the side-bar, they will call hteir own page.
I have tried useing the innerHtml as an attribute of the link, but that didn't work eitgher.
Is the mechanism used wrong, or is just a problem of syntax?
-
06-06-2008, 11:02 PM #5
Re: problem with linking a page
JS is case-sensitive. Capitalization do matters.
The correct syntax is innerHTML.
Anyway, what you wanted to achieve is impossible to do with innerHTML. Your simple way of achieving this is through iframe.
You could also use ajax to do this stuff for you, but i'm out of my wits on it.
Hope it helps.
-
06-07-2008, 11:10 PM #6
Re: problem with linking a page
iframes certainly helped.
Problem solved - thank you guys.