Ajax With Post Method
javascript Code
<script>
$.ajax({
url: 'https://www.example.com/get_data',
type: 'POST',
dataType: 'JSON',
data: {
id: id,
status : status
},
success: function (data)
{
if(data.url)
{
window.location.href = url;
}
else
{
window.location.reload();
}
}
});
</script>
Php Code
function get_data()
{
$data['url'] = 'http://www.postsparrow.com/';
echo jaon_encode($data);
}
0 Comments