Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- utils.loadJSON('http://localhost:8081/myForum/privileges',function(json){
- console.log(json);
- for(var i = 0, j = json.Users.length; i < j; i++){
- var users = json.Users[i];
- users.tempId = i;
- //console.log(users);
- utils.loadTemplate(
- 'tpl/forms/privilegesForm.html',
- users,
- function(template){
- var submitButton = $('.input-fields-' + i + ' .submit-button'),
- $formUserName = $('.input-fields-' + i +' #user-name'),
- $formUserRole = $('.input-fields-' + i +' #user-role');
- console.log(users.tempId);
- submitButton.on('click',function(eventData){
- console.log('WBIJAM KURWA');
- utils.sendData('http://localhost:8081/myForum/privilegesForm',{
- userName: $formUserName.val(),
- userRole: $formUserRole.val()
- },function(response){
- console.log(response);
- if(response.success == 'true'){
- //
- alert('Done!');
- }else{
- alert('Something went wrong');
- }
- });
- });
- }
- );
- }
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement