Theory and Practice
About Archives Categories Tags Authors 中文 ไทย
  1. Categories
  2. GopherJS

Install GopherJS in Go Modules Mode

September 20, 2021

Build and run GopherJS in Go modules mode.

 read more »

[GopherJS] WebSocket Client Example With Echo Server

May 18, 2017

Simple example of a WebSocket client via GopherJS. Connect and send a message to the WebSocket server that echos everything from clients.

 read more »

[Golang/GopherJS] Chrome Extension for Chinese Conversion

April 30, 2017

Build Chrome Extension with Go, compiled to JavaScript via GopherJS. This post show you how to build Chrome extension that convert the web page of Simplified Chinese website to Traditional Chinese.

 read more »

Embed Data in Front-end Go Code

April 08, 2017

Embed data/assets/resources/binary in Go code, and compiled by GopherJS to a single JavaScript file which runs on the front-end browser.

 read more »

Online Conversion of Traditional and Simplified Chinese in Go/GopherJS

February 20, 2017

Go front-end programming - online service for conversion of Traditional and Simplified Chinese via GopherJS/godom/gojianfan.

 read more »

[GopherJS] Virtual Keyboard

January 31, 2017

Virtual kayboard/keypad in GopherJS. Used in Pāli Dictionary.

 read more »

[GopherJS] Animate.css Test Demo

January 24, 2017

Use Animate.css and GopherJS to animate your webpage.

 read more »

[GopherJS] Test if an Element Contains a Class

January 15, 2017

Test if an element contains a class via GopherJS.

 read more »

[GopherJS] Access href Value of Anchor <a> Tag

January 06, 2017

Access (raw) href value of anchor tag (<a>) via GopherJS.

 read more »

[GopherJS] null Test

January 05, 2017

Test if a variable is null via GopherJS.

 read more »

[GopherJS] HTML Web History API Example

January 03, 2017

Change browser URL without reloading web pages - Example for HTML history API via GopherJS.

 read more »

[GopherJS] window.location - Access URL

January 02, 2017

Access URL, path, query string, etc. of current URL via window.location and GopherJS.

 read more »

[GopherJS] Setting Implementation via JSON and Web Storage (localStorage)

January 01, 2017

Implementation of setting feature in web application via JSON, Web Storage, and GopherJS.

 read more »

[GopherJS] Keyboard Event - Arrow Keys Example

December 31, 2016

Detect arrow keystrokes via GopherJS.

 read more »

[GopherJS] createElement and createTextNode DOM Example

December 30, 2016

DOM Example of createElement and createTextNode via GopherJS.

 read more »

[GopherJS] mouseenter and mouseleave Event Example

December 27, 2016

Example of onmouseenter and onmouseleave event via GopherJS.

 read more »

[GopherJS] Focus and Blur of DOM Element

December 19, 2016

Focus and Blur of DOM element via GopherJS.

 read more »

[GopherJS] Traverse DOM Tree

June 14, 2016

Traverse DOM tree via GopherJS.

 read more »

[GopherJS] Replace DOM Element in Place

June 13, 2016

Replace DOM element in place via GopherJS.

 read more »

[GopherJS] Check nodeType of DOM Element

June 12, 2016

Check node type (nodeType) of DOM element via GopherJS.

 read more »

[GopherJS] Access Child Nodes of DOM Element

June 11, 2016

Access child nodes (childNodes) of DOM element via GopherJS.

 read more »

[GopherJS] Add Tooltip to Every (Pāli) Word

June 10, 2016

Add tooltip to every word via GopherJS. Used in Pāli Tipiṭaka.

 read more »

[GopherJS] Treeview

June 09, 2016

Treeview via GopherJS. Used in Pāli Tipiṭaka.

 read more »

[GopherJS] Resizable Views

June 08, 2016

Resizable views via GopherJS. Used in Pāli Tipiṭaka.

 read more »

[GopherJS] Register Event Handler (Event Binding)

June 07, 2016

Two ways to register event handler via GopherJS: Set element on-Event property or addEventListener.

 read more »

[GopherJS] getElementsByTagName

June 06, 2016

Use getElementsByTagName to access head element via GopherJS.

 read more »

[GopherJS] Tooltip

June 05, 2016

Tooltip via GopherJS. Used in Pāli Tipiṭaka.

 read more »

[GopherJS] Insert CSS Dynamically

June 04, 2016

Insert (add, append) CSS to head element via GopherJS.

 read more »

[Golang/GopherJS] setTimeout

June 03, 2016

JavaScript setTimeout equivalent in Go/GopherJS - time.AfterFunc.

 read more »

[GopherJS] this Keyword

June 02, 2016

Show how to access/use this keyword via GopherJS.

 read more »

[GopherJS] Set/Get DOM CSS

June 01, 2016

Example - Set or Get CSS property of DOM element via GopherJS.

 read more »

[GopherJS] Copy to Clipboard

April 01, 2016

Copy content of textarea to clipboard via GopherJS.

 read more »

[GopherJS] Element Position (Offset)

March 25, 2016

Get DOM element position (offset) via GopherJS.

 read more »

[GopherJS] insertAfter - Insert New Node After Reference Node

March 14, 2016

insertAfter - Insert new node after reference node via GopherJS. (opposite of insertBefore)

 read more »

[GopherJS] Get head Element in HTML Document

March 13, 2016

Access head element in HTML document via GopherJS.

 read more »

GopherJS XMLHttpRequest (XHR) and MakeFunc Example

February 18, 2016

Show how to use MakeFunc in GopherJS by XMLHttpRequest (XHR) example.

 read more »

[Golang] Test if Item Exist in Web Storage by GopherJS

February 16, 2016

Check if an item exists (is populated) in web storage (localStorage or sessionStorage) by GopherJS.

 read more »

[Golang] querySelectorAll and querySelector Example by GopherJS

February 14, 2016

Go querySelectorAll and querySelector Example by GopherJS.

 read more »

[Golang] Toggle-able Sidebar by GopherJS

February 09, 2016

Go toggle-able sidebar by GopherJS, inspired by Octopress.

 read more »

[Golang] Caveats of GopherJS Development

February 07, 2016

Fix runtime error via goroutine in Go code compiled to JavaScript by GopherJS.

 read more »

[Golang] undefined Test in GopherJS

February 06, 2016

Check if something (object, variable, API, ...) is undefined or not in GopherJS.

 read more »

[Golang] Input Text Element Enter Keypress Event by GopherJS

February 01, 2016

Add the enter keypress event handler for the input text element by GopherJS

 read more »

[Golang] Remove All Child Nodes of a DOM Element by GopherJS

January 31, 2016

Go programming language - Remove all children of a DOM element by GopherJS.

 read more »

[Golang] GopherJS Synonyms with JavaScript

January 29, 2016 (Updated: January 15, 2017)

Synonyms - Go/GopherJS idioms and snippets translated to JavaScript

 read more »

[Golang] gettext Function on Frontend (Browser) by GopherJS

January 28, 2016

Implement gettext function on front-end (browsers) by GopherJS. The gettext function translates a text string into the user's native language.

 read more »

[Golang] Access HTTP Request Header by XHR getAllResponseHeaders()

January 25, 2016

Run Golang program in your browser by GopherJS. Access HTTP Request Header by getAllResponseHeaders() method in XMLHttpRequest (XHR) request.

 read more »

[Golang] Access HTTP Request Header (Accept-Language) by JSONP

January 24, 2016

Run Golang program in your browser by GopherJS. Access Accept-Language field in HTTP Request Header by JSONP to detect browser language preference (user locale).

 read more »

[Golang] Detect Browser Language Preference by window.navigator.language

January 24, 2016

Run Golang program in your browser by GopherJS. Access window.navigator.language of NavigatorLanguage API to detect browser language preference (user locale).

 read more »

[Golang] JSONP Example (CORS) by GopherJS

January 23, 2016

Run Golang program in your browser by GopherJS. Show how to make cross-domain requests (CORS) by JSONP (JSON with Padding) technique, which allows data to be retrieved from servers of other domains. This is an example of full-stack Go, which uses Golang to develop web applications in both front-end and backend.

 read more »

[Golang] XMLHttpRequest (XHR) HTTP POST JSON Data by GopherJS

January 21, 2016

Run Golang program in your browser by GopherJS. Use XMLHttpRequest (XHR) to send HTTP POST requests to send JSON data to remote server. This is an example of full-stack Go, which uses Golang to develop web applications in both front-end and backend.

 read more »

[Golang] XMLHttpRequest (XHR) HTTP GET JSON Data by GopherJS

January 20, 2016

Run Golang program in your browser by GopherJS. Use XMLHttpRequest (XHR) to send HTTP GET requests to retrieve JSON data from remote server.

 read more »

[Golang] Toggle (Show/Hide) HTML Element by GopherJS

January 18, 2016

Run Golang program in your browser by GopherJS. Show how to write a Go program to do DOM manipulation by example. This example show how to toggle (show/hide) a HTML element by GopherJS and its DOM binding.

 read more »

[Golang] Draggable (Movable) Element by GopherJS

January 17, 2016

Run Golang program in your browser by GopherJS. Show how to write a Go program to do DOM manipulation by example. This example show how to write a draggable/movable element by GopherJS and its DOM binding.

 read more »

[Golang] GopherJS DOM Example - Dropdown Menu

January 16, 2016

Run Golang program in your browser by GopherJS. Show how to write a Go program to do DOM manipulation by example. This example show how to write a dropdown menu by GopherJS and its DOM binding.

 read more »

[Golang] GopherJS DOM Example - Toggle (Play/Pause) Sound on Click Event

January 15, 2016

Run Golang program in your browser by GopherJS. Show how to write a Go program to do DOM manipulation by example. This example show how to toggle (play/pause) sound on click event of a HTML DOM element.

 read more »

[Golang] GopherJS DOM Example - Play Sound on Click Event

January 15, 2016

Run Golang program in your browser by GopherJS. Show how to write a Go program to do DOM manipulation by example. This example show how to play sound on click event of a HTML DOM element.

 read more »

[Golang] GopherJS DOM Example - Create and Append Element

January 14, 2016

Run Golang program in your browser by GopherJS. Show how to write a Go program to do DOM manipulation by example. This example show how to create a new HTML element and append it to the DOM tree.

 read more »

[Golang] GopherJS DOM Example - Hide Element by display:none

January 13, 2016

Run Golang program in your browser by GopherJS. Show how to write a Go program to do DOM manipulation by example. This example show how to hide HTML elements by setting its CSS property display:none.

 read more »

[Golang] Online Snake Game by GopherJS

January 13, 2016

Online snake game using Go programming language, compiled to JavaScript by GopherJS. (GopherJS DOM example)

 read more »

[Golang] Online Input Method (Pāli) by GopherJS

January 12, 2016

Online Pali (Pāli, Pāḷi) Input Method using Go programming language, compiled to JavaScript by GopherJS. (GopherJS DOM example)

 read more »

[Golang] GopherJS DOM Example - Access HTML Data Attribute

January 12, 2016

Run Golang program in your browser by GopherJS. Show how to write a Go program to do DOM manipulation by example. This example shows how to access HTML data-* attribute.

 read more »

[Golang] GopherJS DOM Example - Access Input Element Value

January 11, 2016

Run Golang program in your browser by GopherJS. Show how to write a Go program to do DOM manipulation by example. This example show how to access the value of HTML input element.

 read more »

[Golang] GopherJS DOM Example - Detect Keypress (Keyboard Event)

January 11, 2016

Run Golang program in your browser by GopherJS. Show how to write a Go program to do DOM manipulation by example. Detect user keypress by registering keyboard event handler and print out the keycode of the keyboard event.

 read more »

[Golang] GopherJS DOM Example - Event Binding (addEventListener)

January 11, 2016

Run Golang program in your browser by GopherJS. Show how to write a Go program to do DOM manipulation by example. Use addEventListener to attach event handler to specific DOM element.

 read more »

[Golang] GopherJS serve and build Command Usage

January 10, 2016

Example of how to use serve and build command of GopherJS.

 read more »

[Golang] GopherJS DOM Example - getElementById and Set innerHTML

January 10, 2016

Run Golang program in your browser by GopherJS. Show how to write a Go program to do DOM manipulation by example. Use getElementById to access DOM element and set innerHTML of the element.

 read more »
Powered by Github Pages, Pelican, pyScss.