Codeigniter Clone In jQuery |
[eluser]titoneo[/eluser]
Yes, combining views is a good solution! When I said security I only referred to protect views templates with a controller, evidently the Model is in the server and you only can access it with ajax request and receive json data. And, as you say, the model in the client will be for caching data, for example ![]() Now, what I want to say about templates is there will be many cases where it is necessary to iterate over a list of data using the same template block. For example if you build a blog, each post is displayed on the main screen is the same block of the template but with different data. For that, you need some more that only replace 'keywords' by 'datawords'. That is why I have suggested links. I think that the microtemplating proposed by John Resig is lightweight and powerful to start with: http://ejohn.org/blog/javascript-micro-templating/ Another solution that occurred to me is to create views in pure javascript code, views can be simple javascript functions that would build elements of the DOM, this is more tedious to code templates, but the big advantage is that you can load multiple views (javascript files) simultaneously because you can do something like this: Code: var fileref=document.createElement('script') And you will know when are they loaded including a callback the end of file by convention (eg: isloaded_view("view1")). So you can do the ajax request for data at the same time. Well, you have to decide how do this, if you create a new version posted here let me know! Regards! |
Messages In This Thread |
Codeigniter Clone In jQuery - by El Forum - 07-10-2010, 02:47 AM
Codeigniter Clone In jQuery - by El Forum - 07-10-2010, 01:35 PM
Codeigniter Clone In jQuery - by El Forum - 07-10-2010, 06:48 PM
Codeigniter Clone In jQuery - by El Forum - 07-10-2010, 08:34 PM
Codeigniter Clone In jQuery - by El Forum - 07-11-2010, 08:36 AM
Codeigniter Clone In jQuery - by El Forum - 07-12-2010, 09:58 PM
Codeigniter Clone In jQuery - by El Forum - 07-13-2010, 01:34 PM
Codeigniter Clone In jQuery - by El Forum - 09-24-2010, 02:27 AM
|