Make a web app in Go? [closed] - html

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
How can I make a web app in Go?
Is there a way I can interchangeably use Go code and HTML like with PHP and HTML?
More specifically, what I want to know is how to get my PrintLn output to show in a web browser and how to accept input from HTML form fields?

You can't embed Go & HTML (for many, many reasons) but you can use Go's html/template package (http://golang.org/pkg/html/template/) to generate a HTML page from your HTTP handlers.
I'd suggest reading http://golang.org/doc/articles/wiki/ and using http://www.gorillatoolkit.org/ (routes, cookies, etc) for the web server side

You need to setup a web server in go and process http request/response as input/output. There is already an answer about go web frameworks which would be helpful. link
If you don't want your ui to show in a browser window, you will have to bind your own html engine. For that purpose you can look at ui frameworks like walk which has ie based webview builtin or engine bindings like go-webkit which builds a custom webview.

Related

Converting HTML5+CSS+JS project to Polymer (as PWA) [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 3 years ago.
Improve this question
I created a web application with HTML5/CSS/JS and using JavaScript template literals. I am in the process of converting HTML5 pages to use custom web components (rewriting the HTML pages) and make it PWA.
However,
Application is not a single page application
Application uses responsive Material template (css and js that should stay)
I need to convert to Progressive Web App (PWA) using workbox.
I am looking for advise, if Polymer or Lit-Element or HTMLElement would allow maximum code reuse.
Also, any web application (HTML5 with css, js) can be converted to PWA - right?
Having web components will provide better performance, but not a criteria for converting to PWA?
Don't use Polymer; I suggest you look into lit-element for components and lit-html for templates; they work very well together but you can use anything for templates, of course.
As far as I'm aware this is the official recommendation of people who were working on the Polymer project at Google. There is an active community on Slack you can go to for help, too.

Correct way of page separation and inclusion in HTML/Bootstrap [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
I'm starting to work with HTML/Bootstrap, trying to have a website with several pages. The way I'm doing it is just to code each page separately, but I see that there are some elements in my page that are just the same (the navbar for instance).
I'm thus asking what is the correct way of separating the pages in this kind of scenario. Is it just to put each part in a separated HTML file, and including it?
I'm using Python Django as a framework and saw that there is a tool called Flask that looks to be dividing the page into sections, is it related or is it a complete different thing?
Bootstrap is a set of CSS (mostly, there are some JS bits too).
How you share code between different pages on your site is entirely independent of Bootstrap.
You would typically solve this problem using a template language. Since you said you are using Django, you can use the built-in template system.
I'm using Python Django as a framework and saw that there is a tool called Flask
Flask is an alternative to Django. It uses a different template system.
Actually you are looking for a template engine in Python and common option is to use Jinja2 and you are looking for template inheritance check this link, Flask is a micro framework which can be used instead of Django, but you you have to move from Flask to Django you can use Jinja as template engine in both.

How do I use HTML and CSS in an EXE [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 7 years ago.
Improve this question
I'm looking for a way to program with HTML and CSS and have it render in the form of a Windows application.
What is the best way to do this, so I don't have to get my hands too dirty using C++?
EDIT: I see seamonkey is very confused about what im asking, so ill explain. I want to program in HTML/CSS and use that program as an offline application instead of a webpage. Ive heard useful tips like including IE9's html renderer in my program and also using HTA files or even using Chrome apps. Im still open to other suggestions.
If you are using Visual Studio, you (in essesnce) embed the Internet Explorer viewer into your application. I have done it before and it is pretty easy. To do that, just create an MFC application then use the MFC WebBrowser Control
Here is an article on how to do that.
https://msdn.microsoft.com/en-us/library/aa752046(v=vs.85).aspx

Making a HTML Template [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
So I want to create a template that looks something like this:
http://i.stack.imgur.com/Qf38Y.png (Not enough rep to post photos, I'm new)
(I'm in high school and have just completed a HTML class)
I know how to make the template but I want to make it so that I can just write the title, image location and content in a form or text document and have it create a new html page with the information. I AM NOT ASKING YOU TO MAKE THE TEMPLATE FOR ME! I also need it to be able to update the pages if I change the template. Is this possible? If so please leave any tutorials below. I am NOT asking for you to write the code for me, I am just looking to see if this is possible and what languages it would require.
Thanks Much!
For that you will have to write an application, which will convert the data given by the user into an HTML webpage. This will require using JavaScript, HTML and CSS together. You can create an HTML page which will have <input> tags in it. Then using JavaScript libraries, such as FileSaver.js, you can create an HTML file and add data to it with JavaScript, probably using .appendChild() method. This was for a webapp, that will work in a browser, for desktop app you can use other programming languages or use Adobe AIR to package your webapp for desktop.

How to parse the DOM of a page on another domain [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
I've been having a lot of trouble parsing the DOM of a remote webpage using AJAX. I don't seem to be able to find any example or tutorials demonstrating this procedure.
I basically want to search through the DOM of a remote page, find a tag with a specific id/class, take the inner contents of that tag and print it out on my own page.
If anyone can help i'd appreciate it.
The same-origin-policy browsers have do not allow you to access external pages for security reasons. You need to use e.g. a PHP script on your server to retrieve the external site's HTML. Then you can make an AJAX call to that script instead.
You could always use this: http://simplehtmldom.sourceforge.net
Easy to use.