Ajax() not sending data
Ajax() not sending data
Hi,
I'm new to JQuery and a bit iffy on some of the syntax, which I think may be the source of my problem:
The php file that processes the data being sent is working properly as I've tested it independently.
Everything else is working also - except that the data (in 6) is not being sent, as returndata in 7 is empty.
I'd appreciate any help.
- $(document).ready(function() {
// generate markup in cells
$(".addBK").append("<a href='#' title='Bookmark this page!'>Bookmark!</a> ");
$('#bookmark').jqm();
setTimeout($('#dialog').jqmShow(),2000);
- //apply click handlers to anchors
$(".addBK a").click(function(e){
// stop normal link click
e.preventDefault();
- $("#bookmark").show();
- $("#desc").focus();
- $("#bkButton").click(function(evt) {
//evt.preventDefault(); // this stops the data being sent to the php file!
- $.ajax({
type: "POST",
url: "addBK-ajax.php",
//data: "user=" + $(this).attr('id'),
data: "user=" + $("#user").attr('value')
+ "&" + "bk=" + $("#bk").attr('value')
+ "&" + "desc=" + $("#desc").attr('value'),
- success: function(returndata) {
alert( "Result: " + returndata);
}
});
});
});
});