Hello all,
I am creating a creating a "action" for ajax call.
ossn_register_action('post/approve','actions/post/approve.php');
with this code the URL for ajax is working but not able to send and receive data from post/approve.php
code for approve.php
<?php
$postverification = new OssnPostapprove;
$data = $_POST['post_id'];
echo $data;
jquery code to make ajax call
Ossn.Approvepost = function(post_id){
var datalist = 'post_id = '+post_id;
Ossn.ajaxRequest({
url:Ossn.site_url+'action/post/approve',
data:datalist,
beforeSend: function(request) {
console.log(datalist);
},
callback: function(callback) {
console.log(callback)
}
});
}
Hello Arsalan,
thanks for the reply,
as you suggested i changed the function as
Ossn.Approvepost = function(postid){
var datalist = 'postid = '+postid;
Ossn.ajaxRequest({
url:Ossn.siteurl+'action/post/approve?data='+post_id,
beforeSend:function(request){
console.log(datalist);
},
callback: function(callback) {
console.log(callback)
}
});
}
but now its not making any ajax call can you please let e know why the ajax call is not happening
The Ossn.ajaxRequest
isn't supposed to work same like jquery ajax() the paramter data:datalist,
is invalid. You need to specify the data into URL like ?data=xx
Due to the many requests in the past for additonal features and components we have decided to develope a premium version. Features like Hashtags, Videos, Polls, Events, Stories, Link Preview, etc included in it.
$199 (Life Time)