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.
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.)
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