I'm dealing with how to send successful response to jquery's iframe post form plugin.
With the help of the source code of the plugin's demonstration, I can see that there is the following code below: (Click here for source)
complete : function (response)
{
var style,
width,
html = '';
if (!response.success)
// I've always came to this block! And that is exactly the problem that I have
{
$('.message').slideUp(function ()
{
$(this)
.html('There was a problem with the image you uploaded')
.css({
color : '#9c0006',
background : '#ffc7ce',
borderColor : '#9c0006'
})
.slideDown();
});
}
else /***** When is the response successful and when will code come here? *****/
{
/*
following code goes here...
*/
}
}
The exact question is that when do the response.success
will be TRUE? And how should I set it to TRUE
with PHP? (Please answer both with and without JSON
style)