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

  • SEARCH
  • Home
  • 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 3277488
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T19:22:29+00:00 2026-05-17T19:22:29+00:00

I am developing an eshop and the client wants ajax. I think that this

  • 0

I am developing an eshop and the client wants ajax. I think that this is a bad idea because its going be slow.

However while viewing the products there are some filters on the left. When a user selects a filter some other should be disabled.

For example there may be jackets for both males and female, but the red colour is only available for females, so when the user clicks male, the red filter should be disabled.

I am wondering which is the best way to achieve this. I would not use ajax for this just load all the products of the category and filter them with Javascript but I can’t because I must use ajax.

So should I make a separate call like .getJson('filters.php.....', currentFilters, callback)? and then decide which filters will be disabled? (This requires executing more queries at the database)

Or is it possible to include in the results page something like this:

<script type=text/javascript>
    var data={jsondatagoeshere};
</script> 

I wonder whether all browsers will execute this code. Any other suggestion?

  • 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-17T19:22:29+00:00Added an answer on May 17, 2026 at 7:22 pm

    Both will work fine but it all depends on how large the data is.

    Another method is to filter the results directly on the page like (hide unmatched items):

    Quick example:

    html

    <ul>
      <li>Item1 <span>tag1, tag2</span></li>
      <li>Item2 <span>tag1, tag3</span></li>
    </ul>
    

    css

    span { display:none }
    

    jquery

    $(".filter").click(function() {
      $("ul > li").hide().filter(function() {
         return $("span", this).text().indexOf("tag1") >= 0;
      }).show();
    });
    

    This will filter instantly and without having to recall the database multiple times but as I said it all depends on how large the data is.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Developing a web application that I've registered with Twitter. In this app, I might
I am developing an eshop and i have to do a sitemap... I think
Developing Java, you have always learned that its best to create an ArrayList by
When developing whether its Web or Desktop at which point should a developer switch
When developing an application that sends out notification email messages, what are the best
Developing is more of a hobby at the moment; so apologies if this is
Developing a little survey webapp, ran into problem that deals with ranges for rating
While developing with Firebug I keep getting this error. pages[x].css(z-index,x) is not a function
I am developing an eshop .At products page based on category i putted some
Hello In the CMS of the eshop i am developing the other developer for

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.