S
S
semki0962016-05-07 21:29:39
PHP
semki096, 2016-05-07 21:29:39

How to work with frontend based on JS?

The backend returns the data as an array. I can display them in a standard loop. But if I want full-fledged interactivity of the frontend - do I understand correctly that I should convert this array to JSON and already work with it - for example, display it using the handelbars template engine? Or is it better to use php, and handelbars and json will be included later, for example for ajax requests?

There is another point - if the page is complex, then it probably makes sense to build a dom on the client, which means that I immediately need to convert the data to JSON, right? ps. If so - what is the best way to pass php variable (with json string) to js?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Denis Ineshin, 2016-05-07
@IonDen

1. Google Rest API
2. Google client-side frameworks: Ember.js, Angular.js, etc.

B
beduin01, 2016-05-08
@beduin01

vuejs.org

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question