Jump to content


Photo

Open new page through hyperlinks in the <div> tag.


  • Please log in to reply
3 replies to this topic

#1 wackyflik

wackyflik
  • New Members
  • Pip
  • Newbie
  • 8 posts

Posted 02 October 2006 - 05:17 PM

how do i open any webpages by clicking hyperlinks located at the left side and the page will be displayed in the <div="content"> tag instead of using <iframe>? here is my code:

<body>
<div id="container">
	<div id="banner">
		<h1>Banner</h1>

	</div>
	<div id="nav">
		<p>Welcome, <?php echo $_SESSION['user']; ?> [<a href="../auth/logout_process.php">Sign Out</a>]</p>
		<p>
		<div id="list-menu">
		<ul>
		<li><a href="default_menu.html" target="content">Home</a></li>
		<li><a href="about_us.html" target="content">About Us</a></li>
		<li><a href="../faculty/form_faculty.php?op=add" target="content">Add New Faculty</a></li>
		<li><a href="../faculty/view_faculty.list.php" target="content">Lists of Faculties</a></li>
		<li><a href="../program/form_program.php?op=add" target="content">Add New Program</a></li>
		<li><a href="../program/view_program.list2.php" target="content">Lists of Programs</a></li>
		<li><a href="../student/form_student.php" target="content">Add New Student</a></li>
		<li><a href="../attendance/form_attendance.php" target="content">Add New Attendance</a></li>
		<li><a href="../attendance/view_all_bydate.php" target="content">View Attendance List</a></li>
		</ul>
		</div>
		</p>

	</div>
	<div id="content">
		<!-- display webpages here -->
	</div>
	<div id="footer">
		<p>
		Master of Science in Information Technology
		<br />
		ITT 751 - Advanced Internet &amp; Web Programming
		<br />
		Copyright &copy; 2006
		</p>
	</div>
</div>
</body>


#2 Daniel0

Daniel0
  • Staff Alumni
  • Advanced Member
  • 11,956 posts

Posted 02 October 2006 - 05:44 PM

I don't get your question, could you provide more details please? And it seems like it's more like a HTML question...

#3 wackyflik

wackyflik
  • New Members
  • Pip
  • Newbie
  • 8 posts

Posted 02 October 2006 - 10:53 PM

like this, i am using CSS for my layout design which is totally different from the previous website. here is the hyperlinks that i have:

<div id="list-menu">
		<ul>
		<li><a href="default_menu.html" target="content">Home</a></li>
		<li><a href="about_us.html" target="content">About Us</a></li>
		<li><a href="../faculty/form_faculty.php?op=add" target="content">Add New Faculty</a></li>
		<li><a href="../faculty/view_faculty.list.php" target="content">Lists of Faculties</a></li>
		<li><a href="../program/form_program.php?op=add" target="content">Add New Program</a></li>
		<li><a href="../program/view_program.list2.php" target="content">Lists of Programs</a></li>
		<li><a href="../student/form_student.php" target="content">Add New Student</a></li>
		<li><a href="../attendance/form_attendance.php" target="content">Add New Attendance</a></li>
		<li><a href="../attendance/view_all_bydate.php" target="content">View Attendance List</a></li>
		</ul>
</div>

if u can see, there is a target in the <a> tag which is content. i want when i click any of the hyperlinks, the page will be displayed in the:

<div id="content">
		<!-- display webpages here -->

</div>


#4 ToonMariner

ToonMariner
  • Members
  • PipPipPip
  • Advanced Member
  • 3,342 posts
  • LocationNewcastle upon Tyne, UK

Posted 03 October 2006 - 09:58 AM

What you are trying to achieve applies to framsets.

You need to use ajax to do what you want to do. Grab the nwe content and then use

document.getElementById('content').innerHTML = newcont;

where new cont is all the html you want in there.
follow me on twitter @PHPsycho




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users