Question:
I'm working on a complex web application and don't know backend development very well. Can I just build HTML pages and tie into them?
Bryce
2017-02-21 15:15:30 UTC
I have an idea about a complex web application. I know HTML and CSS pretty well but don t know backend development. I have brought on a friend of mine to do that part. My question is, can I build plain ole HTML pages and have the backend developer tie into those? Is there anything that I should consider using from a front end development perspective like Angular?
Four answers:
Chris
2017-02-21 17:12:52 UTC
The best approach really depends on the kind of data you're going to present.



Having said that, a backend should be agnostic when it comes to presentation. So what you can do is have your friend write a backend that provides certain endpoints, like this: http://site.com/article/346

The backend will send JSON which contains text, other data, image URLs, etc.



In your app you request the JSON using AJAX, then insert the various pieces of data into divs or other elements.





So the short answer is: basically yes, but the more you know about the interactions between frontend and backend, the better.

You should be well versed in how to use $.get(...), basically.
Robert J
2017-02-21 15:54:14 UTC
Nothing will appear in the web pages unless you specifically include it in the html code; that's all the web browser sees.



One approach is to have everything "printed out" by the backend (eg. PHP) code; however that's not really suitable for what you want.





Another is to use a template system such as Smarty. That totally separates the backend code from the visual appearance of the site.



With that, a PHP backend purely generates the data that varies from page to page, and feeds that to the template engine. When everything is ready, it tells the engine to use a specific template file to display that page.





The templates are just html pages [with a different suffix], with inserts where you want the changeable data to appear.



It's a perfect split between backend and display [html] code.



It can also do things like looping, so for eg. a variable size table or list, you can pass the number of entries and an array of data, then the template automatically show the correct number of data rows or sections



It also caches the templates as it compiles them so after the first view of a page (new or after editing) it does not slow the site down - and can actually improve responses.



http://www.smarty.net/



It needs a bit of setting up on the web server, but it's quite straightforward and well documented.
Sadsongs
2017-02-21 15:51:16 UTC
Prepare a set of pages that show the different types - homepage, contact form etc - so the developer has examples of all that he or she will have to generate. Note: any on-page behaviours (Javascript) should be discussed with the developer before final decisions on time and cost.
Daniel B
2017-02-21 15:23:59 UTC
If you are truly developing a "complex" web application then you really need to work closely with the backend developer. If you just build a bunch of HTML pages and then toss them over to the back end developer you probably aren't going to get the best results.


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...