Solved

Jquery to make the page smaller?

Posted on 2016-08-08
3
55 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

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

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

Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
Although it can be difficult to imagine, someday your child will have a career of his or her own. He or she will likely start a family, buy a home and start having their own children. So, while being a kid is still extremely important, it’s also …
This video teaches users how to migrate an existing Wordpress website to a new domain.
Any person in technology especially those working for big companies should at least know about the basics of web accessibility. Believe it or not there are even laws in place that require businesses to provide such means for the disabled and aging p…

910 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

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now