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 2 of 2
  1. #1
    New Coder
    Join Date
    Sep 2011
    Location
    127.0.0.1
    Posts
    67
    Thanks
    19
    Thanked 0 Times in 0 Posts

    $.ajax not working in FF :(

    AJAX.JS:

    Code:
    $("#buttonLogout").click(function() {
    	$.ajax({
    		type: "GET",
    		url: "/assets/ajax/logout.php"
    	}).done(function( data ) {
    		alert(data);
    		window.location="/login.php";
    	});
    	alert("clicked");
    });
    LOGOUT.PHP:
    PHP Code:
    <?php
        session_start
    ();
        
    $_SESSION['loggedin']=0;
        
    $_SESSION['nick']="";
        echo 
    1;
    ?>
    The script doesn't alert anything and doesn't redirect me.


    What I'm doing wrong?
    Last edited by sonic656; 08-11-2012 at 01:08 PM.
    My website is here: http://www.moowdesign.eu/. It is not complete yet, and I want to add language translations for some languages(including english).

  • #2
    Senior Coder
    Join Date
    Jan 2011
    Location
    Missouri
    Posts
    4,347
    Thanks
    23
    Thanked 618 Times in 617 Posts
    Code:
    <script type="text/javascript">
    $(document).ready(function(){
      $("#buttonLogout").click(function(){
        $.ajax({
    		type: "GET",
    		url:"/assets/ajax/logout.php",
    		success:function(result){
    		alert(result);
          $("div").html(result);
        }});
      });
    });
    </script>


  •  

    Posting Permissions

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