Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <script type="text/javascript">
- $(".clickMe").click(function(){
- $.ajax({
- dataType: 'json',
- type:'GET',
- url: "{{ url('loadMore/4') }}",
- }).done(function(data){
- var len=data.length;
- console.log(len);
- //Perform ANy action after successfuly post data
- var rows = '';
- for(i=0; i<data.length; i++){
- rows += data[i].titulo;
- }
- $("#morePosts").html(rows);
- })
- });
- </script>
- public function loadMore($numRecibido){
- $post = Publicacion::take(1)->skip($numRecibido)->get();
- return response()->json($post);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement