A simple threading example in ajax