Solved

Jquery to make the page smaller?

Posted on 2016-08-08
3
69 Views
Last Modified: 2016-08-08
Hi, I have pages of news articles that get really long: http://www.magickitchen.com/news/health.html

Can I use jquery or ajax to do something like this?:

It would be great to show the top six articles, then have a Plus sign or a see more button, ad have the rest of the content appear on the same page. I'm learning jquery and ajax,  but I'm not sure yet how to use them in real world applications. So I could use some advice and some examples, if possible. Thanks!
0
Comment
Question by:mel200
  • 2
3 Comments
 
LVL 30

Accepted Solution

by:
Alexandre Simões earned 500 total points
ID: 41747313
Depending on the amount of data, you might actually consider two approaches:

1. Real lazy-loading
If you really have a lot of items which, in my opinion, is not the case of the page you gave us as an example, then you can create a lazy loading feature like adding a "More" button.
This is like a paged list, meaning that on the server-side you need to have method that receives the page number and page size and gives you the items for that page.
Once you have that, then just append the items to the HTML.

2. Fake lazy-loading
On the other hand, if this is just to make things pretty, then you can just fake this paging mechanism.
You can still have the whole HTML on the page but only show it gradually.

It's your call :)
1
 

Author Comment

by:mel200
ID: 41747329
Thanks; do you have examples of these? :)
0
 

Author Closing Comment

by:mel200
ID: 41747367
Thanks, I found examples. Good solutions
0

Featured Post

MIM Survival Guide for Service Desk Managers

Major incidents can send mastered service desk processes into disorder. Systems and tools produce the data needed to resolve these incidents, but your challenge is getting that information to the right people fast. Check out the Survival Guide and begin bringing order to chaos.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Get to know the ins and outs of building a web-based ERP system for your enterprise. Development timeline, technology, and costs outlined.
Because your company can’t afford for you to make SEO mistakes, you’ll want to ensure you’re taking the right steps each and every time you post a new piece of content. This list of optimization do’s and don’ts can help you become an SEO wizard.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

840 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question