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

    Failing in loading the Preloader

    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
    Senior Coder NancyJ's Avatar
    Join Date
    Feb 2005
    Location
    Bradford, UK
    Posts
    3,172
    Thanks
    19
    Thanked 65 Times in 64 Posts
    For a start, you're failing to identify the correct forum to post in. This is not a php issue.

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

    sorry for posting it in a wrong section

    Noted immediately!!! and reposting it in javascript section.
    Thanks


    Quote Originally Posted by NancyJ View Post
    For a start, you're failing to identify the correct forum to post in. This is not a php issue.


  •  

    Posting Permissions

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