Skip to main content
ctp_coco
Participant
August 18, 2018
Answered

Frames Refresh problem (urgent!!)

  • August 18, 2018
  • 1 reply
  • 602 views

Hi. I am now working on my school project which required me to create a website. For a easier management, i create a frameset.

However, when i am reviewing my website in Chrome, i find that every time when i press the refresh button (F5), it will bring me back to the homepage.

What should i do to correct this problem and let it stay on the same page??

I found that this problem only happened when i am using Chrome cause I've try it on IExplore and everything is fine.

Sorry for any grammar mistakes and i hope that someone can help me asap since i have to hand in the project before September.

This topic has been closed for replies.
Correct answer BenPleysier

The best solution is to use SSI (Server Side Includes), but this requires PHP. If you do not have PHP, the likelihood of being able to use SSI is practically none.

To use this option

1. create an include file called nav.php - actually, the extension can be anything including html and txt. I tend to use nav.inc.php.

<ul>

  <li><a href="index.php">Home</a></li>

  <li><a href="services.php">Services</a></li>

  <li><a href="about.php">About</a></li>

</ul>

2. include the file into your main document e.g. index.php

<!doctype html>

<html>

<head>

<meta charset="utf-8">

<title>Untitled Document</title>

</head>

<body>

  <?php include 'nav.php'; ?>

  <div> content goes here </div>

</body>

</html>

The next best option is to use JS (JavaScript).

1. create an include file called nav.js

document.getElementById("navMenu").innerHTML =

'<ul>'+

  '<li><a href="index.html">Home</a></li>'+

  '<li><a href="services.html">Services</a></li>'+

  '<li><a href="about.html">About</a></li>'+

'</ul>';

2. include the file into your main document e.g. index.html

<!doctype html>

<html>

<head>

<meta charset="utf-8">

<title>Untitled Document</title>

</head>

<body>

  <nav id="navMenu"></nav>

  <div> content goes here </div>

  <script src="nav.js"></script>

</body>

</html>

A last option is to use an IFRAME as in HTML Iframes. I will not expand on this because it comes will all sorts of adjustments.

1 reply

Nancy OShea
Community Expert
Community Expert
August 18, 2018

Do not use frames.   Frames were dropped from HTML5  several years ago.   Most modern browsers and mobile devices cannot support  frames.  I hope for your sake that your instructor is not telling you to use frames because nobody uses them anymore.

Nancy O'Shea— Product User & Community Expert
ctp_coco
ctp_cocoAuthor
Participant
August 19, 2018

Oh I see. But without using the frame, I will have to copy my banner and menu to every page and I afraid that I will mess up all the hyperlink. Do you have any better suggestion to help me with the management?

BenPleysier
Community Expert
BenPleysierCommunity ExpertCorrect answer
Community Expert
August 19, 2018

The best solution is to use SSI (Server Side Includes), but this requires PHP. If you do not have PHP, the likelihood of being able to use SSI is practically none.

To use this option

1. create an include file called nav.php - actually, the extension can be anything including html and txt. I tend to use nav.inc.php.

<ul>

  <li><a href="index.php">Home</a></li>

  <li><a href="services.php">Services</a></li>

  <li><a href="about.php">About</a></li>

</ul>

2. include the file into your main document e.g. index.php

<!doctype html>

<html>

<head>

<meta charset="utf-8">

<title>Untitled Document</title>

</head>

<body>

  <?php include 'nav.php'; ?>

  <div> content goes here </div>

</body>

</html>

The next best option is to use JS (JavaScript).

1. create an include file called nav.js

document.getElementById("navMenu").innerHTML =

'<ul>'+

  '<li><a href="index.html">Home</a></li>'+

  '<li><a href="services.html">Services</a></li>'+

  '<li><a href="about.html">About</a></li>'+

'</ul>';

2. include the file into your main document e.g. index.html

<!doctype html>

<html>

<head>

<meta charset="utf-8">

<title>Untitled Document</title>

</head>

<body>

  <nav id="navMenu"></nav>

  <div> content goes here </div>

  <script src="nav.js"></script>

</body>

</html>

A last option is to use an IFRAME as in HTML Iframes. I will not expand on this because it comes will all sorts of adjustments.

Wappler is the DMXzone-made Dreamweaver replacement and includes the best of their powerful extensions, as well as much more!