Price Search Engine - need some advice

Discussion in 'jQuery' started by stephan2307, Feb 16, 2012.

  1. #1
    I am building a price search engine script. I got the basics working but I would like to have advice on 2 things.

    1. I am loading all prices via jquery. Each price is fetched by a different script (1 script per online store). At the moment there are only 3 scripts and I run 3 separate ajax posts to get the data. Now if I have 100 scripts I assume this would be very inefficient. Any advice on how I can do this better?

    2. I am loading all results into a div. I am using currently the prepend function of jquery. However what i would like to do is to automatically sort the prices. Lowest to Highest. Is there an easy way to do this?

    Thanks in advance.
     
    stephan2307, Feb 16, 2012 IP
  2. Rukbat

    Rukbat Well-Known Member

    Messages:
    2,908
    Likes Received:
    37
    Best Answers:
    51
    Trophy Points:
    125
    #2
    1. Depends on your site(s). If you want to load a lot of prices on one page, load them all with one select. (You can have a "page" field, so you can load all prices for page1, page2, etc.)

    2. Select with an ORDER BY clause, ordering by price.

    (Both functions are done on the server, of course, not in jQuery.)
     
    Rukbat, Feb 25, 2012 IP
  3. stephan2307

    stephan2307 Well-Known Member

    Messages:
    1,277
    Likes Received:
    33
    Best Answers:
    7
    Trophy Points:
    150
    #3
    Thanks for the tips. however in this case your suggestions won't work. The prices are fetched directly from the websites and then loaded one by one into the website. Therefore I can't do any SELECT or ORDER BY.

    I managed to sort things anyway. thanks
     
    stephan2307, Feb 25, 2012 IP