Jump to content

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


Recommended Posts

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:

[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>[/code]
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:

[code]<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>[/code]

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

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

</div>[/code]
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.
This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.