github.com/zserge/lorca
<input type="text" name="MACADD" style="height:20px; width:210px">
<input type="submit" value="submit" onclick="JSBINDFUNC(MACADD)">
JSBINDFUNCstringMACADDJSBINDFUNC
However, I'm coming back with the err
exception":{"type":"string","value":"json: cannot unmarshal object into Go value of type string"}
objectstring
More complete snip:
package main
import (
"fmt"
"log"
"net/url"
"github.com/zserge/lorca"
)
func main() {
ui, err := lorca.New("data:text/html,"+url.PathEscape(`
<html>
<form action="/action_page.php">
MAC Address:<br>
<input type="text" name="MACADD" style="height:20px; width:210px">
<input type="submit" value="Submit" onclick="JSBINDFUNC(MACADD)">
</form>
</body>
</html>
`), "", 480, 320)
if err != nil {
log.Fatal(err)
}
//ui.Bind implemented @ https://github.com/zserge/lorca/blob/master/ui.go#L110
ui.Bind("JSBINDFUNC", func(MAC string) {
fmt.Println(MAC)
return
})
defer ui.Close()
<-ui.Done()
}