Created
December 12, 2018 01:45
-
-
Save goofmint/38dbee3df07dc91bfd81e9c8e1ebefef to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
go func() { | |
todo := document.Call("getElementById", "todo") | |
var value = todo.Get("value").String() | |
input, err := json.Marshal(Input{Todo: value}) | |
res, err := http.Post(domain, "application/json", bytes.NewBuffer(input)) | |
if err != nil { | |
log.Fatal(err) | |
} else { | |
addTodo(document, value) | |
} | |
defer res.Body.Close() | |
}() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment