i am facing problem in showing ajax call " request response" in alert method.
i checked the ajax call in browser it shows response well, mean ajax call works and it gets some repose but this reponse does not alert in showRepose method
here is my code
jQuery( window ).ready(function() {
var atts = <?php echo json_encode($atts ); ?>;
var options = {
target:'#output2', // target element(s) to be updated with server response
// other available options:
url:"<?php echo admin_url('admin-ajax.php'); ?>", // override for form's 'action' attribute
//url:"<?php echo PLUGIN_URI; ?>check-ajax.php",
data:{'btn_send_form_email':'1','process_ajax':'1','atts':JSON.stringify(atts),'action':'get_post_information'},
type:"post", // 'get' or 'post', override for form's 'method' attribute
//dataType: null // 'xml', 'script', or 'json' (expected server response type)
//clearForm: true // clear all form fields after successful submit
//resetForm: true // reset the form after successful submit
// $.ajax options can be used here too, for example:
//timeout: 3000
beforeSubmit: showRequest, // pre-submit callback
success:showResponse , // post-submit callback
};
// bind to the form's submit event
jQuery("form[name='wemblo_frontend_form_<?php echo $form_id;?>").submit(function()
{
// inside event callbacks 'this' is the DOM element so we first
// wrap it in a jQuery object and then invoke ajaxSubmit
jQuery(this).ajaxSubmit(options);
// !!! Important !!!
// always return false to prevent standard browser submit and page navigation
return false;
});
function showResponse(responseText, statusText, xhr, $form)
{
// for normal html responses, the first argument to the success callback
// is the XMLHttpRequest object's responseText property
// if the ajaxSubmit method was passed an Options Object with the dataType
// property set to 'xml' then the first argument to the success callback
// is the XMLHttpRequest object's responseXML property
// if the ajaxSubmit method was passed an Options Object with the dataType
// property set to 'json' then the first argument to the success callback
// is the json data object returned by the server
alert('status: ' + statusText + '
responseText:
' + responseText +
'
The output div should have already been updated with the responseText.');
}