Special Characteristics of volist tags in thinkphp in ajax operations (recommended), thinkphpvolist
Background
Implement the volist label in a complex page (including volist) of ThinkPHP to display the return of Jquery query results
Knowledge Point
The purpose of ajax is to refresh some table data without refreshing the entire page. However, note that the volist tag in the ThinkPHP framework is running on the server, therefore, the thinkPHP tag cannot be used for dynamically obtained data using js.$ This-> ajaxReturn ($ data );
Directly use$ ("# Div_id"). HTML (data)
.
Existing solutions (all have defects)
1. Create a new page for display
Open a new jump page and return the value $ this-> assign ("volist_name", $ data.
** Defect: it is equivalent to re-loading the entire page and does not meet the requirements of some update forms.
2. display without the tag of the thinkPHP framework
If the volist label is not used, the results returned by ajaxReturn are analyzed and displayed according to the template of your own js. Partial form updates can be implemented.
1. template<Script id = "events-template" type = "x-tmpl-mustache" >{{# data }}
Summary
The above section describes the special characteristics of the volist tag in thinkphp in ajax operations (recommended). I hope it will help you. If you have any questions, please leave a message, the editor will reply to you in a timely manner. Thank you very much for your support for the help House website!