Jquery $.post method doesn't work
<p>Background: I'm using Apache with XAMPP to set up localhost.
I'm relatively new to programming, and very new to PHP. I'm trying to call a PHP file in the same directory as my Javascript file, but the code I'm using doesn't seem to work. Here's a sample:</p>

<p>Javascript:</p>

<pre><code>function SendPhps(){
var point = 2;'
$.post('json.php',point);}
$(document).ready(function(){
SendPhps();
});
</code></pre>

<p>PHP:</p>

<pre><code>&lt;?php
if(!empty($_POST)){
file_put_contents('example.txt','Itworks');
}
?&gt;
</code></pre>

<p>EDIT: Ok, I've revised my scripts to be more simple, but opening my page still doesn't trigger any alert box:</p>

<p>PHP:</p>

<pre><code>&lt;?php
    if (empty($_POST))
        echo "empty";
    else
        echo "not empty";
?&gt;
</code></pre>

<p>Javascript:</p>

<pre><code>$(document).ready(function() {
    var point = {'param':2};
    $.post(
        'json.php', 
        point, 
        function(data){
            alert(data);
        }
    );
});
</code></pre>
