Posting data to self using jquery
<p>I am trying to post some form data to self with no success.My code is as follows</p>

<pre><code>&lt;html&gt;
    &lt;title&gt;Post to self&lt;/title&gt;
    &lt;script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"&gt;

    &lt;/script&gt;
    &lt;script type="text/javascript"&gt;
        $(document).ready(function () {
            $('.x-button').live("click", function () {
                $.ajax({
                    type: "POST",
                    url: "self.php",
                    data: $(".aj").serialize(),
                    success: function (data) {
                        alert("Data Loaded:");
                    }
                });
            });
        });
    &lt;/script&gt;
    &lt;/head&gt;

    &lt;body&gt;

               &lt;?php
              if(isset($_POST['submit']))
              {
             echo $_POST['firstname'];
              }
              ?&gt;
            &lt;form name="input" action="" class="aj" method="post"&gt;
                &lt;article&gt;
                    &lt;label&gt;Firstname&lt;/label&gt;
                    &lt;input type="text" name="firstname" value="Ed" class="x-input"
                    /&gt;
                &lt;/article&gt;
                &lt;article&gt;
                    &lt;label&gt;Lastname&lt;/label&gt;
                    &lt;input type="text" name="lastname" value="Doe" class="x-input"
                    /&gt;
                &lt;/article&gt;
                &lt;article&gt;
                    &lt;label&gt;City&lt;/label&gt;
                    &lt;input type="text" name="city" value="London" class="x-input"
                    /&gt;
                &lt;/article&gt;
                &lt;input type="submit" value="Update Options" class="x-button" /&gt;
            &lt;/form&gt;
    &lt;/body&gt;

&lt;/html&gt;
</code></pre>

<p>When using <code>&lt;form name="test" action="&lt;?php echo htmlentities($_SERVER['PHP_SELF']); ?&gt;" method="post"&gt;</code> in plain php and html it works but i can't get it to work with jquery.</p>
