Advertisement
Guest User

Untitled

a guest
Feb 8th, 2016
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.99 KB | None | 0 0
  1. setInterval(function(){
  2. $.ajax({
  3. type:'GET',
  4. url: base + '/user/' + id + '/notifications',
  5. dataType: "html",
  6. success: function(data)
  7. {
  8. var data = $(data);
  9. for (var i = 0; i < data.length; i++) {
  10. console.log(data[i]);
  11. $('.notifications li:last-child').after(data[i]);
  12. };
  13. }
  14. });
  15. console.log('refrešano');
  16. }, 1000);
  17.  
  18.  
  19. // dobim iz tukaj html:
  20.  
  21. @foreach($notifications as $notif)
  22. <?php
  23.  
  24. $post = DB::table('posts')->where('id', '=', $notif->id)->first();
  25. ?>
  26. @if($notif->read === 0)
  27. <li class="unread"><a href="{{route('notificationRedirect', $notif->link)}}" title="{{$notif->text}}">{{$notif->text}}</a>
  28. <div class="bubble unread">
  29. </div>
  30. </li>
  31. @else
  32. <li><a href="{{route('notificationRedirect', $notif->link)}}" title="{{$notif->text}}">{{$notif->text}}</a>
  33. <div class="bubble read">
  34. </div>
  35. </li>
  36. @endif
  37. @endforeach
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement