I read and understand the following notes and send this form.ItemPlastic Monster
Level: 20 Subscribe
function toggle_subscribe_user(target){
var user = $(target).attr("user");
var dataparam = "tuser=" + user;
$(target).prop("disabled", true);
if ($(target).attr("sub")){
// 購読解除なのでメッセージを表示する
var result = confirm("You want to unsubscribe this user?");
if (!result){
$(target).removeAttr("disabled");
return;
}
}
$.ajax({
url: "/plm_beam/userajax.php?c=tcairtogglesubscribeuser",
data: dataparam,
dataType: "json",
type: "POST",
success: function(data){
$(target).removeAttr("disabled");
if (data["error"]){
// error がある
alert(data["error"]);
}else if (data["register"]){
// 新規に購読した
$(target).text("Subscribed");
$(target).prev("img").attr("src", "/img/subscribed-user.png");
$(target).attr("sub", "1");
}else{
// 購読を解除した
0コメント