1.
var data = {"id_ai":id_ai, "info_type":type, "a":Math.random()} var form = $('<form />', {action : "ajax_get_product_detail", method:"post", style:"display:none;"}).appendTo('body'); $.each(data, function(k, v) { if ( k != "url" ){ form.append('<input type="hidden" name="' + k +'" value="' + v +'" />'); } }); form.append('<input type="hidden" name="csrfToken" value="' + $("#csrf_token").val() + '" />' ); form.submit();