javascript - Variables not defined when access using AJAX -


i'm stumped - trying variables typical drag , drop - they're showing fine in alert use test, ajax tells me droppedid undefined?

$( ".folder" ).droppable({     drop: function( event, ui ) {      var draggedid = $(ui.draggable).attr("id");     var droppedid = $(this).attr("folderid");      alert ('dropped ' + draggedid + ' folder ' + droppedid); // works ok      $.ajax({          type: "post",         url: '/ajax/actions/draglink.php?folder_id=' + droppedid + '&bm_id=' + draggedid,         data: $form.serialize(),         success: function (data) {              $("#myaction").load('/ajax/actions/links.php?success=true&folder_id=' + data);                          }                      }); // end .ajax function                  }             }); 

javascript case sensitive.

you need use droppedid

url: '/ajax/actions/draglink.php?folder_id=' + droppedid + '&bm_id=' + draggedid, 

notice it's droppedid , not droppedid


Comments

Popular posts from this blog

java.util.scanner - How to read and add only numbers to array from a text file -

rewrite - Trouble with Wordpress multiple custom querystrings -