Welcome Guest, Not a member yet? Register   Sign In
Community Auth Token Name
#14

(01-20-2018, 10:16 PM)skunkbad Wrote:
(01-20-2018, 08:20 PM)reesethebeast Wrote: Thanks Skunkbad. I have the same code but it currently is not updating the hidden input field value. I modified the Auth form helper to include ID on the hidden token field as there was just name previously. This still did not do the trick but once I get this working I should be set.

Code:
$(document).ready(function(){
$(document).on("click","#delete_bookmark",function(a){
a.preventDefault();
var b=$(this).attr("bookmark_id"),
c=$(this).closest("tr"),
d=$("input[name=token").val();

$.ajax({type:"POST",
url:"deletebkmark",
data:{token:d,bookmarkid:b},
dataType:"json",
success:function(a){
if (a.status == 'X')
{
$("#token").val(a.new_token);
$("#list_count").html(a.count);
c.remove();
}
else
{
alert("Error occurred. Please contact support.");
}
}
})
}),
})

Any chance that the "a" var has some sort of conflict because you have 2 "a"s ?? One is on your click event, and the other is your AJAX response data.

Hmmm, wow, I guess that was it. Good catch. The JS minification changed the variable names. This is working now. Thanks for all of your help.
Reply


Messages In This Thread
Community Auth Token Name - by reesethebeast - 01-17-2018, 07:17 PM
RE: Community Auth Token Name - by skunkbad - 01-18-2018, 12:27 AM
RE: Community Auth Token Name - by reesethebeast - 01-18-2018, 06:42 AM
RE: Community Auth Token Name - by reesethebeast - 01-18-2018, 08:14 AM
RE: Community Auth Token Name - by skunkbad - 01-18-2018, 09:04 AM
RE: Community Auth Token Name - by reesethebeast - 01-18-2018, 09:29 AM
RE: Community Auth Token Name - by reesethebeast - 01-18-2018, 09:46 AM
RE: Community Auth Token Name - by skunkbad - 01-18-2018, 12:13 PM
RE: Community Auth Token Name - by reesethebeast - 01-18-2018, 02:21 PM
RE: Community Auth Token Name - by reesethebeast - 01-18-2018, 11:18 PM
RE: Community Auth Token Name - by skunkbad - 01-18-2018, 11:38 PM
RE: Community Auth Token Name - by reesethebeast - 01-20-2018, 08:20 PM
RE: Community Auth Token Name - by skunkbad - 01-20-2018, 10:16 PM
RE: Community Auth Token Name - by reesethebeast - 01-21-2018, 06:17 AM
RE: Community Auth Token Name - by skunkbad - 01-21-2018, 10:51 AM



Theme © iAndrew 2016 - Forum software by © MyBB