...

View Full Version : preloader issue



bhakti_thakkar
07-17-2007, 03:08 PM
Hi all,
i have 2 php pages i.e relations.php and save_relations.php. the relation form action ="save_relations.php" where there is just the saving of the user inputs and then redirecting the user to the view. i have written a ajax-javascript in save_relations that gives me an error "null" is not an object
can some one please tell me where am i failing

<?
if ($submit=="save") {
// save code goes here
}
?>

<script language="javascript" type="text/javascript">
<!--
ajaxFunction();
//Browser Support Code
function ajaxFunction(){
var ajaxRequest; // The variable that makes Ajax possible!

try{
// Opera 8.0+, Firefox, Safari
ajaxRequest = new XMLHttpRequest();
} catch (e){
// Internet Explorer Browsers
try{
ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
try{
ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
} catch (e){
// Something went wrong
alert("Your browser broke!");
return false;
}
}
}
ajaxRequest.onreadystatechange = function(){

if(ajaxRequest.readyState == 4){
alert(ajaxDisplay);
var ajaxDisplay = document.getElementById('ajaxDiv');

ajaxDisplay.innerHTML = ajaxRequest.responseText;
}
}
var ajaxDisplay = document.getElementById('ajaxDiv');
ajaxDisplay.innerHTML ="<img src='images/loading.gif'> <b>loading..</b>";
window.location.href="relations.php?relation_id=<?=$relation_id?>";


}

//-->
</script> <div id='ajaxDiv'> </div>

jscheuer1
07-17-2007, 06:19 PM
There really isn't enough code there. You have code to decide which type of request object is supported and code to process the data from said request. I see no code to actually make the request or to determine what file is to be requested.

bhakti_thakkar
07-18-2007, 05:22 AM
Thanks for your reply. i am unable to do it.. can you please suggest me a code for Preloader when my data is geting save?


There really isn't enough code there. You have code to decide which type of request object is supported and code to process the data from said request. I see no code to actually make the request or to determine what file is to be requested.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum