Javascript + AJAX + Client-Side HTML Template + High performance

Hi,
i created a public API in PHP.

Now i am in the process of creating a first web client in HTML + JS, this is the first time i am developing a Client Web Application.

That being said, i am looking for advice, library resources, anything that could help with this questioning:

- I need the application to be lightning fast
- I want to completly abstract the Client from the Web Server and created a 100% AJAX application
- I want all html to be created on the client side dynamically, my servers only receive and send JSON data
- For the reason above, i don't want to use MVC pattern, i want to offload my server from any html generation as possible, except for the first load of the web application
- Currently i created about 40% of the Client with what i call 'HTML template'
- HTML Template are basically HTML put and escaped into a string variable as a constant on the javascript side, when i need something specfic, i clone the string and fill the data inside it before appending the html to the web page container
- It currently work and is EXTREMELY FAST since everything is generated on the client side, there is no wait
- All communications to the API is in AJAX

Problems:
* Storing the HTML templates directly in the javascript code is not very clean even tho it work, and it always require me to escape the html and redeploy every time i change something

* I was thinking of maybe a plugins or framework exist for javascript that could make client-side templating better

* I was also thinking that i could probably generate the template dynamically on the first load from the PHP code by retrieving the HTML file and dropping it into the javascript code

Any help is appreciated,
thanks in advance!
EnillAsked:
Who is Participating?
 
EyalCommented:
0
 
RobOwner (Aidellio)Commented:
You're right about storing the html in the javascript.  As you say it's not clean and if you're not "reusing" the html it's a waste of time.  You are, as you suggest, better off requesting the template from PHP at the beginning and then I would suggest changing the layout based on your json in combination with CSS and javascript.

I'm unaware of a plugin or framework for this and I would imagine it would be quite hard to write given that the end result is so subjective.  Sounds like you've done most of the work towards this anyway.
0
 
iGottZFrontend EngineerCommented:
Eyal is right. the template engine behind his link has been made by the founder of jquery. its speedy and cross browser compatible.
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

 
BadotzCommented:
>>its speedy and cross browser compatible. (sic)

And also no longer being developed. That should tell you something.
0
 
RobOwner (Aidellio)Commented:
I agree with Badotz... bad idea to use an unsupported plugin
0
 
iGottZFrontend EngineerCommented:
then why do you accept it as solution? that doesnt make sense oO
0
 
EyalCommented:
I don't see anyone has sugested better solution.
0
 
BadotzCommented:
Not all questions have a solution that you like. Some have no solution at all. Accepting a non-solution as the solution makes no sense.

Why not ask for more advice, or just delete the question?
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.