jquery ajax image

Posted by Nishima on Stack Overflow See other posts from Stack Overflow or by Nishima
Published on 2009-08-11T09:34:32Z Indexed on 2010/06/13 6:02 UTC
Read the original article Hit count: 360

Filed under:
|
|

Hi all,

I am sending an ajax request on dblick for creating the image of the screen where it is double clicked.I am ising imagegrabscreen() function of PHP to create image but instead of creating its image it is creates a black image.

dblclick(function (ev,ui)
                {
                var response = $.ajax({
                type:"POST",
                url: "grabImage.php",
                data:"name=John&location=Boston&function_name=img",
                complete: function(msg){
                    var resp = msg.responseText;
                    if(msg && msg.readyState != 4) { alert("Ready State :"+msg.readyState); return;  }
                    else{
                        //wb_load();
                        alert( "Data Saved: " + resp);

                }
                }
     });

                }
            );

GRAB IMAGE FUNCTION

function img()
    {
    $im = imagegrabscreen();
    imagepng($im, "C:\myscreenshot.png");
    //echo $im;
    //imagedestroy($im);
    return $im;
    define('imge',$im);
    }

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about AJAX