I didn't look too closely at the files, but I suggest separating your data from the executing code. Use JSON to create a series of data objects and use a different script to run through those objects and build your page based on search criteria, etc.
>From what I saw in cruise_json.js, there's a lot of repeated if statements and variables. I have a feeling it would be easy to reduce that code. I could be missing the actual data file.. Also, it would be very helpful for troubleshooting if the demo you provided would have properly formatted code so that it would be easier to read. That's the main reason I didn't look too carefully. On May 27, 2:01 am, andymott <a...@arc-max.com> wrote: > Hello Guys, > > I have created a site using jquerywww.arc-max.com/cruisesearch/the > problem lies in the initial loading of the result page (the front page > is a bit slow but that I can optimize that on my own) . I am using > json to store the result set. The json file can get a bit bloated up > anywhere between 200-400kb depending on the number of results . After > optimizing the graphics and using gzip I have been able to reduce the > load time to around 20 seconds depending on the number of results > (this based on a first time load). > > Since i am not that good at optimizing i wanted to know ... > > a) Can the jquery code or the json data be optimized further? is it a > badly written code ? I know this is very subjective but i am sure > there are things that could be done that i have no clue about ...so > would like to show it to you guys who have had some experience in > analyzing codes. > > b) is this possible and how ? to load two json object one with say 20 > results the other with all the results including the first 20. > Initially the first json object gets loaded (small file faster > download hence faster loading of page) while the bigger file gets > loaded in the background and once the user starts using the filter the > data gets pulled in from the complete result file (the bigger file). > > Thanks for our help > andy