Answer the question
In order to leave comments, you need to log in
How to write a frontend for a web application in go?
In continuation of the topic How to display the values of a variable on an html page in go?
Tell me - if I need, for example, to transfer a whole array from the go application to the html page, then how should I process it, how to access one or another array element (and string)? I'm really bad at this stuff. I assume that I need to use some hooks in the go program for requests from html pages? and on html pages to write scripts on ("something" / java-script?) that will send get / post to the application? Or am I fundamentally wrong? Tell me the direction please.
Answer the question
In order to leave comments, you need to log in
Have you read this?
https://golang.org/doc/articles/wiki/#tmp_6
An example of working with an array:
In the html template, write like this
<ul>
{{range .}}
<li>{{.Item}}</li>
{{end}}
</ul>
array:= []string{"abba", "bo", "rat"}
ExecuteTemplate("templateName", arrray)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question