PDA

View Full Version : SECURITYTOKEN in jquery


ThorstenA
02-19-2011, 01:26 PM
How can I give a securitytoken to a script? This does not work:

$(document).ready(function(){
$("form#submit").submit(function() {
var SECURITYTOKEN = "{vb:raw bbuserinfo.securitytoken}";
$.ajax({
type: "POST",
url: "misc.php",
data: "do=updatethis&securitytoken =" + SECURITYTOKEN,
success: function(){
$('form#submit').hide(function(){$('div.success'). fadeIn();});
}
});
return false;
});
});

Lynne
02-19-2011, 05:33 PM
Did you mean to put a space between securitytoken and the = sign? I don't think you want that.

ForumsMods
02-19-2011, 05:46 PM
Not necessary to define the security token. vB does it by default when loading page.
Also take a note that you have a space before = sign.