View Full Version : Help needed :(
Liam.
28-08-2006, 09:14 PM
Ok, I have a layout in tables but I want to know how I can make it stay expanding but open the links on the nav so that the links open in the main content.. As when I normally link them without using iframes it refreshed the whole page meaning my radio will keep refreshing.
Examples:
Clubhabbo.net
Thinkhabbo.com
etc etc
+rep if you help ;]]
ClubTime
28-08-2006, 10:00 PM
Use PHP nav links. http://techtuts.com
Liam.
28-08-2006, 10:03 PM
index.php?page=whatever
That one?
ClubTime
28-08-2006, 10:04 PM
Here this will help
http://www.techtuts.com/?view=tutorials&act=tutorial&id=189
Liam.
28-08-2006, 10:16 PM
Doesn't work for me, just opens the link in a blank page doesn't go in the content box.. Doesn't even include the text in the white page :S
Kymux
28-08-2006, 10:30 PM
shame techtuts got hacked lmaoo
Liam.
28-08-2006, 10:31 PM
lol yeah
Liam.
28-08-2006, 10:32 PM
i've sorted this anyway thanks chris
Both of your examples use IFrames, and using PHP to get content depending on the URL will still cause the page to refresh (as PHP is a server-side language). To load content into a DIV (without the page refreshing), you'll need to use JavaScript.
<html>
<head>
<title></title>
<script>
<!--
try {
var request = new XMLHttpRequest();
} catch(e) {
var request = new ActiveXObject('Microsoft.XMLHTTP');
}
function loadPage(page) {
request.open('get', page);
request.onreadystatechange = function () {
if(request.readyState == 4) document.getElementById('content').innerHTML = request.responseText;
}
request.send(null);
}
-->
</script>
</head>
<body>
<a href="#" onclick="loadPage('news.htm');">News</a>
<div id="content"></div>
</body>
</html>
Liam.
28-08-2006, 11:09 PM
Where do I insert that? In the index where the table is?
Place the SCRIPT tags inside your HEAD, and add the ID "content" to your column. I haven't tested the script though.
Liam.
30-08-2006, 10:11 AM
kk ill try it later im off now
Liam.
30-08-2006, 03:09 PM
doesn't work ;[
Are you using the links like:
<a href='#' onclick="loadPage('news.htm');">News</a> (news.htm being the address to the page)?
Liam.
30-08-2006, 07:20 PM
Thanks, it works. I was typing url in where the # was :P
Thanks again +rep ;]]]
Want to hide these adverts? Register an account for free!
Powered by vBulletin® Version 4.2.5 Copyright © 2025 vBulletin Solutions Inc. All rights reserved.