dynamic html from javascript or c#?
I am having an application where there are alot of divs with elements inside them are created dynamically on javascript events . so I am wondering which is better for performance and maintenance ?? to create those divs i开发者_如何转开发n javascript and insert them to the html or to get them from wcf restful service and insert them in html ??
Using JavaScript is much easier for maintenance especially if you use it with other libraries like jQuery. Performance doesn't matter unless there are at least thousands of divs.
Use WCF Services to get reusable data sets in JSON or XML and then use javascript to create the DOM elements. That way you can reuse your WCF services elsewhere
精彩评论