Hello and welcome to our community! Is this your first visit?
Register
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
    Posts
    2
    Thanks
    0
    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?

    Thanks

  • #2
    Senior Coder rnd me's Avatar
    Join Date
    Jun 2007
    Location
    Urbana
    Posts
    4,460
    Thanks
    11
    Thanked 600 Times in 580 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.
    my site (updated 2014/10/20)
    BROWSER STATS [% share] (2014/9/03) IE7:0.1, IE8:4.3, IE11:9.2, IE9:2.7, IE10:2.6, FF:16.8, CH:47.5, SF:7.8, NON-MOUSE:37%

  • #3
    New Coder
    Join Date
    Aug 2014
    Posts
    27
    Thanks
    0
    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
    •