CodingForums.com

CodingForums.com (http://www.codingforums.com/index.php)
-   Ajax and Design (http://www.codingforums.com/forumdisplay.php?f=55)
-   -   $.ajax not working in FF :( (http://www.codingforums.com/showthread.php?t=270250)

sonic656 08-11-2012 12:26 PM

$.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?

sunfighter 08-11-2012 02:39 PM

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>



All times are GMT +1. The time now is 04:07 PM.

Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.