Added ajax code for markup previews