DOM生成的最佳實踐是什麼?從服務器傳遞完整的html作爲響應或傳遞必要的值並相應地從客戶端創建dom?請建議..dom generation with ajax
0
A
回答
0
這是一個建議。我建議將數據(json或xml)傳遞給客戶端,然後使用這些數據來創建您的DOM元素(這有時被稱爲「最佳實踐」)。
雖然沒有人限制你做你認爲最適合你的情況(恕我直言)。
提示:確保在創建DOM元素時避免循環引用(從而避免內存泄漏)。
問候,
0
答案取決於您的情況。通常,我選擇僅傳回JSON格式的數據,並從那裏進行JavaScript渲染/填充。
相關問題
- 1. php xml generation with xpath
- 2. python and javascript with html generation
- 3. Inkscape groups/layers generation with Cairo/Pycairo SVG?
- 4. NineBlock generation
- 5. Pdf generation in ionic2
- 6. nHibernate with hiLo id generation - 在保存對象圖時選擇'N + 1'
- 7. Sprite generation with Compass and SASS maven plugin missing load path
- 8. Polymerfire dom-repeat with Firebase objects
- 9. python list generation/saving bug
- 10. BackboneJS with XML ajax
- 11. JQUERY AJAX WITH CALLBACK
- 12. phonegap with $ .ajax(Android)
- 13. jQuery FancyBox with Ajax
- 14. Agrotime with Ajax
- 15. pushState with Rails ajax
- 16. Select2 with Ajax + PHP
- 17. rails 3.2 with ajax
- 18. AJAX with Rails 3.0
- 19. eldarion ajax with bootstrap
- 20. Ajax with coldfusion8
- 21. rails fields_for with ajax
- 22. Ember.RSVP.Promise with AJAX call
- 23. $ _SESSION with Ajax
- 24. django media_url with ajax
- 25. Ajax with fallback
- 26. CListView with ajax
- 27. move_uploaded_file with ajax
- 28. jScrollPane with Ajax
- 29. CDI @ConversationScoped with AJAX
- 30. AJAX with history.pushState
Duplicate:http://stackoverflow.com/questions/2035576/severside-processing-vs-client-side-processing-ajax – 2010-04-16 10:34:43