Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Jquery to make the page smaller?

Posted on 2016-08-08
3
Medium Priority
?
110 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 2000 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

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

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

When crafting your “Why Us” page, there are a plethora of pitfalls to avoid. Follow these five tips, and you’ll be well on your way to creating an effective page.
Australian government abolished Visa 457 earlier this April and this article describes how this decision might affect Australian IT scene and IT experts.
This tutorial walks through the best practices in adding a local business to Google Maps including how to properly search for duplicates, marker placement, and inputing business details. Login to your Google Account, then search for "Google Mapmaker…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.
Suggested Courses

972 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