I want to pass some values from JavaScript to PHP using jQuery/AJAX. I have the following \"simplified\" code, not sure what is that I am doing wrong. There seems to be quit
$("#text-id").click(function(e) {// because #text-id is an anchor tag so stop its default behaivour
e.preventDefault();
$.ajax({
type: "POST",// see also here
url: 'text.php',// and this path will be proper
data: {
source1: "some text",
source2: "some text 2"}
}).done(function( msg )
{
alert( "Data Saved: " + msg );// see alert is come or not
});
});
reference ajax