Reputation: 796
I am trying to use the Post Method in my jquery code but it using the Get method for some reason. I am working under the Wordpress Framework which have renamed the "$" function to jquery, which I then renamed to $j. Can anyone help me with this simple function?
$j.ajax({
method: "POST",
url: "extension/marker.php",
data: "series=test",
dataType: "text",
success: function(data){
$j("#text").text(data);
console.log('success' + data);
}
});
PHP File:
<?php
if($_POST['series'] == "test")
echo 'yay!';
if($_GET['series'] == "test")
echo 'boo!';
?>
Upvotes: 2
Views: 96