Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7549959
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T10:05:27+00:00 2026-05-30T10:05:27+00:00

I have a view file like this : <html> <head> <meta name=layout content=main />

  • 0

I have a view file like this :

<html>
<head>
        <meta name="layout" content="main" />
        <title><g:message code="User's profile" /></title>
        <g:javascript library="jquery"/>
        <g:javascript>
         (function() {
              jQuery(function() {
                return $(window).scroll(function() {
                  var url;
                  url = $('.pagination .nextLink').attr('href');
                  if (url && $(window).scrollTop() > $(document).height() - $(window).height() - 50) {
                    $('.pagination').show();
                    $('.pagination').text('Fetching more tasks, please wait!...');
                    return $.get(url, function(data) {
                      $('#scrolling').append(data);
                      return $('.pagination').hide();
                    });
                  }
                });
              });
            }).call(this);
        </g:javascript>
</head>
<body>
    <!--Render the menu for the user-->
        <!--check the size of the task so that we can diplay a meaningful mess if userTasks is empty!-->
        <g:if test = "${userTasks.size() > 0}" >
        <div id = "scrolling">
            <g:each in = "${userTasks}" var = "tasks">
                <div class = "scrolling">
                    <span style = "position:relative; left:360px; font-size:1.2em;"><g:link controller = "tasks" action = "show2" id = "${tasks.id}">${tasks.title}</g:link> </span>
                </div>
            </g:each>
            <div class = "pagination">
                <g:paginate total = "${tasksCount}" controller = "tasks" action = "test" />
            </div>
        </g:if>
        <g:else>
            You don't have any unread tasks!
        </g:else>
        </div>
    <br />
</body>
</html>

This works very similar to Twitter site, i/e when the user scrolls down the bottom of the page will fetch more results and this will be repeated. This works for me, but the problem that I have now is instead of updating my id scrolling part alone, I’m getting the whole page being reloaded again and making the page looks nasty!

Here is how my page looks :
enter image description here

You can clearly see that my whole page layout is been reloading when my scroll bar hits the bottom of the page. How I can get rid of this?

Thanks in advance.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T10:05:28+00:00Added an answer on May 30, 2026 at 10:05 am

    Try this:

     (function() {
          jQuery(function() {
            return $(window).scroll(function() {
              var url;
              url = $('.pagination .nextLink').attr('href');
              if (url && $(window).scrollTop() > $(document).height() - $(window).height() - 50) {
                $('.pagination').show();
                $('.pagination').text('Fetching more tasks, please wait!...');
                $.get(url, function(data) {
                  $("#scrolling").append($(data).filter("#scrolling").html());
                  $('.pagination').hide();
                });
                return $('#scrolling').load(url + " #scrolling", function() {
                  return $('.pagination').hide();
                });
              }
            });
          });
        }).call(this);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Lets say I have a view file that is built like this: <html> ...
I have a top-level _Layout.cshtml that looks something like this: <html> <head> @RenderSection(Header, required:
I have a root view controller with no nib file, I tried adding this
I have this class: class View(object): def main_page(self, extra_placeholders = None): file = '/media/Shared/sites/www/subdomains/pypular/static/layout.tmpl'
I have a file called 34.php?session=2534464a39a2c97cb7113689726a4e52 in my /var/www/html folder but I can't view
Excuse me if this is slightly newbie. I have the main view located @
i have a fileinput field for uploading files ... the view file looks like
The application.html.erb file: <!DOCTYPE html> <html> <head> <title>Site</title> <%= stylesheet_link_tag :all %> <%= javascript_include_tag
I have a .rhtml file and there are many condition checks like this <%
I have a header file which has the html <head> tag in it. I'm

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.