Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- setInterval(function(){
- $.ajax({
- type:'GET',
- url: base + '/user/' + id + '/notifications',
- dataType: "html",
- success: function(data)
- {
- var data = $(data);
- for (var i = 0; i < data.length; i++) {
- console.log(data[i]);
- $('.notifications li:last-child').after(data[i]);
- };
- }
- });
- console.log('refrešano');
- }, 1000);
- // dobim iz tukaj html:
- @foreach($notifications as $notif)
- <?php
- $post = DB::table('posts')->where('id', '=', $notif->id)->first();
- ?>
- @if($notif->read === 0)
- <li class="unread"><a href="{{route('notificationRedirect', $notif->link)}}" title="{{$notif->text}}">{{$notif->text}}</a>
- <div class="bubble unread">
- </div>
- </li>
- @else
- <li><a href="{{route('notificationRedirect', $notif->link)}}" title="{{$notif->text}}">{{$notif->text}}</a>
- <div class="bubble read">
- </div>
- </li>
- @endif
- @endforeach
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement