01.
jQuery(document).ready(
function
(){
02.
03.
jQuery(
'#content'
).on(
'click'
,
'a.rml_bttn'
,
function
(e) {
04.
e.preventDefault();
05.
06.
var
rml_post_id = jQuery(
this
).data(
'id'
);
07.
var
ts = jQuery(
this
);
08.
jQuery.ajax({
09.
url : rml_obj.ajax_url,
10.
type :
'post'
,
11.
data : {
12.
action :
'read_me_later'
,
13.
security : rml_obj.check_nonce,
14.
post_id : rml_post_id
15.
},
16.
success :
function
( response ) {
17.
if
(ts.html()==
"DONE"
) { ts.html(
"MARK AS DONE"
); }
18.
else
{ ts.html(
"DONE"
); }
19.
jQuery(
'.rml_contents'
).html(response);
20.
}
21.
});
22.
23.
24.
});
25.
});