Got Ajax working. Code is still a mess...

Learning the concepts...