- Timestamp:
- 10/01/08 17:35:19 (3 months ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
events/phpframework/codeigniter/trunk/system/application/views/user/main.php
r20311 r20373 3 3 $(function(){ 4 4 $('#follow_button').click(function(){ 5 $.post('<?=site_url('friendships/create')?>', {id: $('#follow_id').val(), ticket: $('#ticket').val()}, followMsg, ' html');5 $.post('<?=site_url('friendships/create')?>', {id: $('#follow_id').val(), ticket: $('#ticket').val()}, followMsg, 'json'); 6 6 return false; 7 7 }); 8 8 }); 9 9 function followMsg(data){ 10 $('div[class="main"]').prepend(data); 10 if (data.status == 'ok') { 11 $('div[class="main"]').prepend(data.html); 11 12 $('#follow_button').hide(); 12 13 $('#remove_button').show(); 13 14 $('#msg').fadeOut(3000); 15 count = parseInt($('#side_count_follow').text()) + 1; 16 $('#side_count_follow').text(count); 17 } 18 else { 19 alert(data.html); 20 } 14 21 } 15 22 … … 17 24 $(function(){ 18 25 $('#remove_button').click(function(){ 19 $.post('<?=site_url('friendships/destroy')?>', {id: $('#follow_id').val(), ticket: $('#ticket').val()}, removeMsg, ' html');26 $.post('<?=site_url('friendships/destroy')?>', {id: $('#follow_id').val(), ticket: $('#ticket').val()}, removeMsg, 'json'); 20 27 return false; 21 28 }); 22 29 }); 23 30 function removeMsg(data){ 24 $('div[class="main"]').prepend(data); 31 if (data.status == 'ok') { 32 $('div[class="main"]').prepend(data.html); 25 33 $('#follow_button').show(); 26 34 $('#remove_button').hide(); 27 35 $('#msg').fadeOut(3000); 36 count = parseInt($('#side_count_follow').text()) - 1; 37 $('#side_count_follow').text(count); 38 } 39 else { 40 alert(data.html); 41 } 28 42 } 29 43 </script>
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)