Advertisement
Guest User

Untitled

a guest
Jun 15th, 2019
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. <script type="text/javascript">
  2.  
  3. $(".clickMe").click(function(){
  4. $.ajax({
  5. dataType: 'json',
  6. type:'GET',
  7. url: "{{ url('loadMore/4') }}",
  8. }).done(function(data){
  9. var len=data.length;
  10. console.log(len);
  11. //Perform ANy action after successfuly post data
  12. var rows = '';
  13. for(i=0; i<data.length; i++){
  14. rows += data[i].titulo;
  15. }
  16.  
  17. $("#morePosts").html(rows);
  18. })
  19.  
  20. });
  21. </script>
  22.  
  23. public function loadMore($numRecibido){
  24.  
  25. $post = Publicacion::take(1)->skip($numRecibido)->get();
  26. return response()->json($post);
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement