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? - var loadedobjects=""
-
var rootdomain="http://"+window.location.hostname
-
-
function ajaxpage(url, containerid){
-
var page_request = false
-
if (window.XMLHttpRequest) // if Mozilla, Safari etc
-
page_request = new XMLHttpRequest()
-
else if (window.ActiveXObject){ // if IE
-
try {
-
page_request = new ActiveXObject("Msxml2.XMLHTTP")
-
}
-
catch (e){
-
try{
-
page_request = new ActiveXObject("Microsoft.XMLHTTP")
-
}
-
catch (e){}
-
}
-
}
-
else
-
return false
-
page_request.onreadystatechange=function(){
-
loadpage(page_request, containerid)
-
}
-
page_request.open('GET', url, true)
-
page_request.send(null)
-
}
-
-
function loadpage(page_request, containerid){
-
if (page_request.readyState == 4 && (page_request.status==200 || window.location.href.indexOf("http")==-1))
-
document.getElementById(containerid).innerHTML=page_request.responseText
-
}
-
-
function loadobjs(){
-
if (!document.getElementById)
-
return
-
for (i=0; i<arguments.length; i++){
-
var file=arguments[i]
-
var fileref=""
-
if (loadedobjects.indexOf(file)==-1){ //Check to see if this object has not already been added to page before proceeding
-
if (file.indexOf(".js")!=-1){ //If object is a js file
-
fileref=document.createElement('script')
-
fileref.setAttribute("type","text/javascript");
-
fileref.setAttribute("src", file);
-
}
-
else if (file.indexOf(".css")!=-1){ //If object is a css file
-
fileref=document.createElement("link")
-
fileref.setAttribute("rel", "stylesheet");
-
fileref.setAttribute("type", "text/css");
-
fileref.setAttribute("href", file);
-
}
-
}
-
if (fileref!=""){
-
document.getElementsByTagName("head").item(0).appendChild(fileref)
-
loadedobjects+=file+" " //Remember this object as being already added to page
-
}
-
}
-
}
-
-
function MM_preloadImages() { //v3.0
-
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
-
var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
-
if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
-
}
-
-
function MM_findObj(n, d) { //v4.01
-
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
-
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
-
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
-
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
-
if(!x && d.getElementById) x=d.getElementById(n); return x;
-
}
-
-
function MM_swapImgRestore() { //v3.0
-
var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
-
}
-
-
function MM_swapImage() { //v3.0
-
var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
-
if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
-
}
2 2145
Tx a stack will give it a bash
Have a great day!
Sign in to post your reply or Sign up for a free account.
Similar topics
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?
....
|
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...
|
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...
|
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
|
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...
|
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....
|
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,...
|
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...
|
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...
|
by: taylorcarr |
last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
|
by: aa123db |
last post by:
Variable and constants
Use var or let for variables and const fror constants.
Var foo ='bar';
Let foo ='bar';const baz ='bar';
Functions
function $name$ ($parameters$) {
}
...
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
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,...
|
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,...
|
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...
| |