Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var Main = {
- sendZakaz:function( form, cart ) {
- $(form).find('.submit').prop('disabled', true);
- console.log(cart)
- return false;
- data = new FormData(form);
- //в зависимости от того, что возвращает FormData
- //объект
- data["cart"] = cart;
- //или строку
- data += "&cart=" + JSON.stringify(cart);
- $.ajax({
- url: "sendZakaz",
- type: "POST",
- data: data,
- contentType: false,
- cache: false,
- processData:false,
- success: function(data){
- var obj = jQuery.parseJSON(data);
- $(form).find('.submit').prop('disabled', true);
- /*if(obj.error == 0){
- $('input[name="name"], textarea[name="zakaz"]').val('');
- $('#okey').text(obj.message);
- $('#okey').slideDown('fast');
- setTimeout(function(){
- $('#okey').slideUp('fast');
- }, 2000)
- return false;
- }
- $('#nookey').text(obj.message);
- $('#nookey').slideDown('fast');
- setTimeout(function(){
- $('#nookey').slideUp('fast');
- }, 2000)
- return false; */
- }
- })
- return false;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement