javascript - Ajax - Render JSon to HTML : View vs Controller -
i want append results of ajax request table have on page. see 2 ways of rendering rows :
my controller return json array decode in view , create javascript function add adequate html markup
my controller directly return html
what best practice on matter?
i use ways
send ajax php file
datatype: 'json'
at
php
: processing data , json_encode data array , die return result htmlon success function of ajax, process data
Comments
Post a Comment