Solved

Jquery to make the page smaller?

Posted on 2016-08-08
3
86 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

[Webinar] How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

Question has a verified solution.

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

Learn by example how to specify CSS selectors for Selenium WebDriver test automation software.
When the s#!t hits the fan, you don’t have time to look up who’s on call, draft emails, call collaborators, or send text messages. An instant chat window is definitely the way to go, especially one like HipChat. HipChat is a true business app. An…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
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)

728 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