jQuery Ajax not passing variable
<p>I'm trying to pass some data via ajax to a function so I can unset a $_SESSION value and it is not working. The jQuery part works and "removes" the <code>&lt;div&gt;</code> from the page properly. However, the ajax in the background is not working. I added the javascript alert for testing and that does not fire.</p>

<p>jQuery code:</p>

<pre><code>     //This function "removes" an individual order item in the basket
      $("#basketItemsWrap").on("click", "li img.delete", function(event) {
        var productIDValSplitter   = (this.id).split("_");
        var productIDVal       = productIDValSplitter[1];  
        $("#notificationsLoader").show();
        $.ajax({  
        type: "POST",  
        url: "includes/ajax/functions.php",
        data: { productID: productIDVal, action: "deleteFromBasket"},  
        success: function(theResponse) {

          $("#order_" + productIDVal).hide("slow",  function() {
            $(this).remove();
            Calc();
          });
          $("#notificationsLoader").hide();
        },
        complete: function(){
        },
        error: function(xhr, status, error){
            var err = eval("(" + xhr.responseText + ")");
            alert(err.Message);
        }
        }); 
      });
</code></pre>

<p>functions.php code:</p>

<pre><code>&lt;?php
session_start();


if ($_POST['action'] == "deleteFromBasket"){
?&gt;
    &lt;script type="text/javascript"&gt;
    alert("test");    
    &lt;/script&gt;
&lt;?php
    unset($_SESSION['order_parts'][$_POST['productID']]);
}
?&gt;
</code></pre>

<p>Apparently it is not properly passing "deleteFromBasket" because it does notenter the if check.</p>

<p>Also, if add "echo $_POST['action'];" on functions.php it doesn't display anything.</p>
