Welcome Guest, Not a member yet? Register   Sign In
Work differentiation between CodeIgniter / jQuery - best practice
#3

[eluser]AndyBC[/eluser]
Mark, thanx for replying.

On this job I can rely on ppl having js enabled (it's for an internal page), so in this case I really can use js for more than the 'bells and whistles' and gracefull degradation is not a big concern. Yet, I think you have a good point about the semantics. Ideally it should be semantically correct. So now I might try to work out a way to use form checkboxes, styled to look/behave like clickable tags.

(for the record: this link might give a solution to do it with pure css: http://www.thecssninja.com/css/custom-inputs-using-css ).

Still I think my main question remains:

I am concerned about duplicating functionality between CI/jquery when it comes to rendering stuff on the page. It seems to me that there are many situations where you would need to have the same 'things' done to a page both on the server and in js.

Take form validation as an example. Ideally it should be done both in the browser, before submit, AND on the server. And we all know, that you at least never should skip the server side validation. But what about the validation error messages?

Do I really need this duplicate functionality:

* Server-side: If (input not valid) { render big red box complaining about input, and suggestions on how to fill out correctly }
* Browser-side: If (input not valid) { render big red box complaining about input, and suggestions on how to fill out correctly }

This would mean two places to update (and using two different languages), to do the same thing.

So, my thought was that a sensible way to handle this would be to skip the server part for things like that, and just serve a vanilla page to the browser along with information to js on what items to act on, e.g. via a js array or something.

Form validation messages is just an example. To my mind the situation is the same whenever you need a round trip to the server (page refresh) and the refreshed page needs to retain the state of some dynamic js-driven element on the page.

Am I getting upset about a non-issue? should I just live with duplicate functionality? Or is there some smart CI way to tackle this?
Or am I thinking about this in some twisted newbie way?

Any enlightenment will be much appreciated :-)

Thanks, Anders


Messages In This Thread
Work differentiation between CodeIgniter / jQuery - best practice - by El Forum - 08-02-2010, 06:18 PM



Theme © iAndrew 2016 - Forum software by © MyBB