How to pass jQuery variable with AJAX to PHP page

Posted by Walden on Stack Overflow See other posts from Stack Overflow or by Walden
Published on 2010-05-15T03:03:40Z Indexed on 2010/05/15 3:14 UTC
Read the original article Hit count: 282

Filed under:
|

Trying to pass the variable "flickrurl" to a PHP page with jQuery/ajax. It works when using a plain text string and not the variable. Am I assigning the variable properly? see the full code in action here: http://is.gd/c9ytI

$trash.droppable({
                accept: '#gallery > li',
                activeClass: 'ui-state-highlight',
                drop: function(ev, ui) {
                    deleteImage(ui.draggable);
                                //set variable equal to src of image tag in #gallery > li
                        var  $flickrurl =  $item.find('img').attr("src");
                //pass variable to php page
                      $.post("updateDB.php", $flickrurl );

                }
            });

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about jquery-ajax