Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3

Thread: preloader issue

  1. #1
    Regular Coder
    Join Date
    Sep 2006
    Location
    India Mumbai
    Posts
    248
    Thanks
    13
    Thanked 1 Time in 1 Post

    preloader issue

    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>

  • #2
    Regular Coder
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    375
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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.
    - John

  • #3
    Regular Coder
    Join Date
    Sep 2006
    Location
    India Mumbai
    Posts
    248
    Thanks
    13
    Thanked 1 Time in 1 Post
    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?

    Quote Originally Posted by jscheuer1 View Post
    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.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •