Tuesday, 15 January 2013

php - How can I add multiple data to $.ajax()? -



php - How can I add multiple data to $.ajax()? -

can show right syntax adding multiple info database. code i`m using below adds 1 data.. know on php side. i'am making drag , drop shopping cart system.

function addlist(param) { $.ajax({ type:"post", url: "ajax/addtocart.php", data: 'img='+encodeuricomponent(param), datatype: 'json', beforesend:function(x){$('#ajax-loader').css('visibility','visible');}, success: function(msg){ $('#ajax-loader').css('visibility','hidden') } }); }

replace

data: 'img='+encodeuricomponent(param),

with

data: {img:param, otherparam:othervalue},

and allow jquery encodings.

php jquery ajax drag-and-drop shopping-cart

No comments:

Post a Comment