I am developing some user interface for the product and we want to use jQuery and PHP. The content to create is a list of flags (10-100) that the user will change (deleting several at a time and changing entries). I thought I would try something new and ask StackOverflow (read: you), which is preferable: generate html in the php call and return or return the JSON data that jQuery can, and then run and create the html flags using.
I appreciate the feedback! My preferred method so far is to allow PHP to generate html because it knows more about the data during modification (it interacts with the database and can easily create html without having to pass identifiers, names, etc. to JSON )
Thank!
[Edit] Bandwidth is not a limitation. This is an internal intranet application. The information that should be printed for the user will not require modification of the dom after the fact (outside the flags, but built into the browser ...) some good comments were made on the amount of data that was returned:
gear back
Label
against. {"Label": "Unique_ID"}
obviously a lot of redundancy.
/ . JSON , HTML , . HTML , ( , , , , ).
- HTML
HTML , -, , , HTML. JSON, script (, / ).
- JSON
, , JSON, . , = 2, "" "" . , script , ( ). , , .
, , , . HTML- , - ( !) script, , ... JSON, script , .
: . DOM , jQuery. , php blob.
, , , DOM , html blob php.
, .
HTML , , JavaScript. , , , , ( , ).
, HTML . , - , JSON - . , . , -, , , - .
JSON DOM- JavaScript.
Cheers,
Source: https://habr.com/ru/post/1769596/More articles:SQL multiple counter connection having problems - sqlHow to check SAML token - .netBest / common practice for delimiting values in C when printing them - cКак организовать .NET-решения, проекты и системные папки для нескольких приложений? - .netWhy does changing a UIScrollView frame change the scope of its subzones? - iphoneHow to cut and save a rectangle from an image? - javaRandom Access Files> 2GB with Android SDK - androidRaw data or pre-calculated values in the database? - performanceCreate a new message with default signature using Exchange Web Services - c #C # handling keystrokes - c #All Articles