Hello and welcome to our community! Is this your first visit?
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Aug 2014
    Thanked 0 Times in 0 Posts

    Are JSON search filter forms inefficient?

    Hey guys I have noticed many developers are starting to implement search filter forms that are using JS, here is a great example: motors.co.uk - Used car search

    If you search vehicles it will automatically update their obviously using Ajax for that part though.

    I need to create the same kind of search and filter form that lists vehicles for a local vehicle dealer I'm working with, at first I was going to use the conventional PHP form however the JSON method seems so much more flexible.

    Motors.co.uk has managed to use this method and can list 100,000's of cars which is starting to make me wonder how they manage it? I only need to display about 120 vehicles which is nothing compared to motors.co.uk.

    All my vehicle data is stored in MySQL I am thinking of creating a PHP script to turn all of that data into a JSON format, I will then display the data however I like from there.

    Would you say this method would work, is there anything I need to be careful of?


  2. #2
    Senior Coder rnd me's Avatar
    Join Date
    Jun 2007
    Thanked 626 Times in 605 Posts
    if i only have hundreds, i would echo all the data as json into my page, and render the list using a template. you can then instantly filter the list with a keyword and re-render instead of making a bunch of ajax calls.
    Create, Share, and Debug HTML pages and snippets with a cool new web app I helped create: pagedemos.com

  3. #3
    New Coder
    Join Date
    Aug 2014
    Thanked 1 Time in 1 Post
    JSON Query gives safe execution with language agnostic code that stops arbitrary code execution. It also utilizes intuitive result-based execution that allows successive query operations.


Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts