Log in

View Full Version : How to get usergroupid by javascript?


hienntp
03-29-2016, 01:02 AM
Hello,
How to get usergroupid of member by javascript? I use vbulletin 5.
Thanks!

Replicant
03-29-2016, 01:14 AM
<script>
$.ajax({
url: vBulletin.getAjaxBaseurl() + '/ajax/api/user/fetchCurrentUserinfo',
type: "POST",
dataType: 'json',
success: function(response) {
if (response && !response['errors'] {
alert( response['usergroupid'] );
}

}
});
</script>