problem with refreshing

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
shemi
Forum Newbie
Posts: 1
Joined: Tue Oct 06, 2009 3:53 am

problem with refreshing

Post by shemi »

:( in my site, i have an index page, it has a main div. this main div's content is changing according to the menu click as home, products etc. div is populating itz contents with html pages for these home, products n projects etc.
header part remains still. when user clicks on products, div is filled with product page. bt problem is , while refreshing the page, i am not getting the products page refrshed. it is going to the index page. what should i do for avoiding that.
m posting my code here

Code: Select all

<head>
 <script> 
function loadNewPage(temp) {
var req = new XMLHttpRequest();
req.open("GET", temp, false);
req.send(null);
var page = req.responseText;
document.getElementById("main").innerHTML = page;
 
}
</script>
</head>
<body>
<div style="position:absolute; left: 119px; top: 129px; width: 782px; height: 39px;"> 
  <ul class="menu">
<li class="top"><a href="" onclick="loadNewPa :( ge('home.php'); return false;" class="top_link"> Home </a>
</li>
<li class="top"><a href=""  onclick="loadNewPage('makeuser1.php'); return false;" target="_self" class="top_link"><span>Registration </span></a>
</li>
<li class="top"><a href="" onclick="loadNewPage('news.php'); return false;" target="_self" class="top_link"> <span>News</span> </a>
</li>
<li class="top"><a href=""  onclick="loadNewPage('complaints.php'); return false;" target="_self" class="top_link"> <span>Complaints </span></a>
</li>
<li class="top"><a href="" onclick="loadNewPage('videos.php'); return false;" target="_self" class="top_link"> <span>Videos</span> </a>
</li>
<li class="top"><a href=""  onclick="loadNewPage('downloads.php'); return false;" target="_self" class="top_link"><span>Downloads</span> </a>
</li>
<li class="top"><a href="" onclick="loadNewPage('about us.php'); return false;" target="_self" class="top_link"><span> About us </span></a>
</li>
<li class="top"><a href="" onclick="loadNewPage('contacts.php'); return false;"  target="_self" class="top_link"> Contact us </a>
</li>
</ul></div>
<div style="position:absolute; left: -1px; top: 164px; height: 1031px; width: 1020px; background-color:#F5F5F5; " id="main"> 
</div>
</body>
frozenarmageddon
Forum Newbie
Posts: 19
Joined: Wed Aug 05, 2009 6:29 pm

Re: problem with refreshing

Post by frozenarmageddon »

Uhm... I understood your problem only after reading your post like 4 times o_o
Please, when you are new in a forum, read the Guidelines which will also point you to this nice little thing.

Sorry, I don't really know how to help you... but reading those two links will help others help you, so... ^^
Post Reply