Advertisement
mithereal

js not passing data array

Dec 15th, 2015
163
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.   function generateImage() {
  2.  
  3.              Imagedata = {
  4.                             product_id:1,
  5.                             product_type_id:"type",
  6.                            
  7.                         };
  8.  
  9.  
  10.              $.ajax({
  11.                 url: 'index.php?route=product/generator/createImage&token=<?php echo $token; ?>',
  12.                  data:  Imagedata ,
  13.                  dataType: 'JSON',
  14.                  contentType: "application/json",
  15.                  method:'POST',
  16.                   async: false
  17.                 }).done(function (data) {
  18.                     alert('generated image');
  19.                 });
  20.                      }
  21.  
  22. //async because we want this to block, in this particular use case
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement