what is the best practice for DOM generation ? passing the full html as response from server or pass necessary values and create dom accordingly from client side ? Please suggest..
A:
This is a suggestion. I would suggest passing data (json or xml) to the client and then using this data to create your DOM elements (this is sometimes proposed as 'best practice').
Although nobody restricts you in doing what you think is best for your case (IMHO).
Tip: Make sure you avoid circular references when creating your DOM element (thus avoiding memory leaks).
regards,
andreas
2010-04-16 10:33:36
A:
The answer depends on your scenario. Typically, I choose to pass back only the data in JSON format and have JavaScript render/populate from there.
Justin Johnson
2010-04-16 10:35:28