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

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

* 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!
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
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.
Determine the Perfect Price for Your IT Services

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden with our free interactive tool and use it to determine the right price for your IT services. Download your free eBook now!

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

And also no longer being developed. That should tell you something.
RobOwner (Aidellio)Commented:
I agree with Badotz... bad idea to use an unsupported plugin
iGottZFrontend EngineerCommented:
then why do you accept it as solution? that doesnt make sense oO
I don't see anyone has sugested better solution.
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?
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.