views:

197

answers:

1

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 );

                }
            });
+5  A: 

jQuery's AJAX functions expect data in JSON form. Try:

$.post("updateDB.php", { 'flickrurl': $flickrurl } );
ceejayoz
Thanks, worked!
Walden
So you're going to thank ceejayoz but not accept his answer?
Bradley Mountford
I tried to click the check when I tested the solution, but for some reason it didn't take.
Walden