In an e-commerce site, when adding an item to a cart, I'd like to show a popup window with the options you can choose. Imagine you're ordering an iPod Shuffle and now you have to choose the color and text to engrave.
I'd like the window to be modal, so I'm using a lightbox populated by an Ajax call. Now I have two options:
What's nice about this is that it trims down the Ajax request to the bear minimum and doesn't mix the data with the markup.
Option 2: Send the HTML markup
But I don't feel comfortable mixing data and markup in an Ajax call for some reason. I'm not sure what makes me feel uneasy about it. I mean, it's the same way every web page is served up -- data plus markup -- right?