473,623 Members | 3,366 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Ajax page reload state

3 New Member
Hi this is a newbie alert! This may seem really basic to most, but I am a total beginner, so please don't laugh, or gif me false info...lol I will use it.

I have an ajax container loading on my site http://www.defyinggravity.co.za/home.html

In Firefox the navigation works perfectly, but in IE, NS and Opera when I scroll to the bottom of a page and then select a new page to navigate to, then the page new page loads from the previous pages state (at the bottom or middle, where ever I had scrolled to)

here is the code for the ajax, can anyone help please?

Expand|Select|Wrap|Line Numbers
  1. var loadedobjects=""
  2. var rootdomain="http://"+window.location.hostname
  3.  
  4. function ajaxpage(url, containerid){
  5. var page_request = false
  6. if (window.XMLHttpRequest) // if Mozilla, Safari etc
  7. page_request = new XMLHttpRequest()
  8. else if (window.ActiveXObject){ // if IE
  9. try {
  10. page_request = new ActiveXObject("Msxml2.XMLHTTP")
  11. catch (e){
  12. try{
  13. page_request = new ActiveXObject("Microsoft.XMLHTTP")
  14. }
  15. catch (e){}
  16. }
  17. }
  18. else
  19. return false
  20. page_request.onreadystatechange=function(){
  21. loadpage(page_request, containerid)
  22. }
  23. page_request.open('GET', url, true)
  24. page_request.send(null)
  25. }
  26.  
  27. function loadpage(page_request, containerid){
  28. if (page_request.readyState == 4 && (page_request.status==200 || window.location.href.indexOf("http")==-1))
  29. document.getElementById(containerid).innerHTML=page_request.responseText
  30. }
  31.  
  32. function loadobjs(){
  33. if (!document.getElementById)
  34. return
  35. for (i=0; i<arguments.length; i++){
  36. var file=arguments[i]
  37. var fileref=""
  38. if (loadedobjects.indexOf(file)==-1){ //Check to see if this object has not already been added to page before proceeding
  39. if (file.indexOf(".js")!=-1){ //If object is a js file
  40. fileref=document.createElement('script')
  41. fileref.setAttribute("type","text/javascript");
  42. fileref.setAttribute("src", file);
  43. }
  44. else if (file.indexOf(".css")!=-1){ //If object is a css file
  45. fileref=document.createElement("link")
  46. fileref.setAttribute("rel", "stylesheet");
  47. fileref.setAttribute("type", "text/css");
  48. fileref.setAttribute("href", file);
  49. }
  50. }
  51. if (fileref!=""){
  52. document.getElementsByTagName("head").item(0).appendChild(fileref)
  53. loadedobjects+=file+" " //Remember this object as being already added to page
  54. }
  55. }
  56. }
  57.  
  58. function MM_preloadImages() { //v3.0
  59.   var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
  60.     var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
  61.     if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
  62. }
  63.  
  64. function MM_findObj(n, d) { //v4.01
  65.   var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
  66.     d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  67.   if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  68.   for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  69.   if(!x && d.getElementById) x=d.getElementById(n); return x;
  70. }
  71.  
  72. function MM_swapImgRestore() { //v3.0
  73.   var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
  74. }
  75.  
  76. function MM_swapImage() { //v3.0
  77.   var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
  78.    if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
  79. }
Feb 7 '07 #1
2 2155
gyung
21 New Member
I helped someone with a similar problem before because I ran into a similar issue. I think you will find all the information you need here:

http://www.thescripts.com/forum/thread588665.html

Hope that helps.
Feb 7 '07 #2
defyinggravity
3 New Member
Tx a stack will give it a bash

Have a great day!
Feb 7 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

11
2333
by: Yarco | last post by:
I want to use "Ajax" to create my web for hobby. But i don't know whether "Ajax" is mature... And what about with php? Someone have experience on it? ....
4
1730
by: Trip | last post by:
Please if someone can help me !!! I need client and server code(principle based on AJAX) for next problem: i have 3 <select> tags on html page.(it must be NO page reload(callback) only select(controles) regeneration !!!) In the first <select> goes countries, which must be pulled from some kind of database (whichever you want). after that if i select some country, second <select> must be filled with regions of that country, and when i...
6
1191
by: Sabin.A.K, Bangalore | last post by:
Seen that AJAX makes the Python interfaces bit more User friendly. The Page refresh problems for the huge applications has slashed down extensively. Page reload has been faded out and eventually the Server responses been printed out in the same page itself. The trendy XML HTTP Request has really struck the way developers had adopted with the user interfaces. But the major issuse are yet to be solved.. 1. Changing state with links (GET...
10
6302
by: Steve | last post by:
I need to build a very dynamic client and would be interested in knowing the pros and cons of using JSF and Ajax to accomplish this. Thanks. Steve
0
1825
by: arunprabu | last post by:
Hi, I have a problecm with the AJAX request in my webpage. I have some filters on top of the page. I have a submit button and an empty div below the filters. Some of the filters have ajax requests to update the content within the filters. For example, I have 2 drop downs, one for state and another for country. When I select a country in the country drop down, an ajax request is sent to fetch appropriate list of states and updates the
6
2107
by: paladin.rithe | last post by:
I'm looking to use AJAX as part of the login system for a project, but I'm not finding what I'm looking for. I've seen the example of how to do an AJAX login, but that isn't really what I want. What I want to do is use XMLHttpRequest to send the request, and send back any errors (no username, bad password, whatever). But, if it is a valid account, I'd like it to login to the system. I haven't been able to find anything like that, and...
1
2465
by: empiresolutions | last post by:
Im using this script, http://www.captain.at/howto-ajax-form-post-get.php, to make an ajax request to php via a drop-down (DD) select. This works fine. Then using this script, http://www.dhtmlgoodies.com/index.html?whichScript=ajax-dynamic-content, i request to show a php page with other form elements in it. These elements are determined by what the first DD of the first request (captain.at) sets a variable to. This works fine.. only the first...
10
2124
by: =?Utf-8?B?RGFuaQ==?= | last post by:
Hi, Trying to create a master page that holds a menu, and the menu switches between pages in the site. 2 problem arrosed: a. When I navigate from page to page (all AJAX Web Forms, with the Master pages as their master...) the entire page is refreshed - also the menu which belongs to the master, how can I fix it - so only the inside content will be refreshed ?
1
3042
by: christian | last post by:
Hello I use a AJAX refresh script on a page to test a $var state <div> <? include ("include/refr.inc.php"); //ajax script for reload require ("bd_inc.php"); //test the line state buzy or free $st = mysql_query("SELECT linestate FROM broad WHERE num='40'");
0
8221
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8162
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8662
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8603
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
7134
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4067
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4154
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2593
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1769
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.