scottcheng / cropit

A "customizable crop and zoom" jQuery plugin.
http://scottcheng.github.io/cropit/
MIT License
874 stars 307 forks source link

For those who want to pass a GET variable in the post / Pour ceux qui veulent faire passer une variable GET dans le post #281

Open mylenenordimage opened 6 years ago

mylenenordimage commented 6 years ago

CE CODE FONCTIONNE ET PEUT AIDER CERTAINS :) THIS CODE WORKS AND CAN HELP SOME:)

$('form').submit(function() {
          var imageData = $('.image-editor').cropit('export');
          $('.hidden-image-data').val(imageData);
          var formValue = $(this).serialize();

          var dest = <?php echo '"'.$_GET['variable'].'"'; ?>;

          $.post("cropit-master/demo/ajax-post.php",{formValue:formValue,dest:dest},function(data){
            alert("Votre image a bien été ajoutée.");
            });