Current location: Hot Scripts Forums » General Web Coding » JavaScript » problem with refreshing:(

problem with refreshing:(

 
Prev Previous Post   Next Post Next
  #1 (permalink)  
Old 10-05-09, 07:47 AM
shemi shemi is offline
Newbie Coder
 
Join Date: Jul 2009
Location: india
Posts: 39
Thanks: 0
Thanked 0 Times in 0 Posts
problem with refreshing:(

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

HTML Code:
<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="loadNewPage('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>
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Share on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
 

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Refreshing Problem scriptfinder JavaScript 0 05-17-09 12:08 PM
refreshing page problem zodehala PHP 1 06-17-08 05:43 AM
refreshing problem. jonnekke HTML/XHTML/XML 1 01-19-08 04:51 PM
Form Display Problem neevrap02 Visual Basic 1 09-05-06 06:18 AM
Asp and Microsoft Access 2002 problem gop373 ASP 2 10-06-04 10:13 AM


All times are GMT -5. The time now is 12:06 AM.
vBulletin® Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.