func mainPage(document dom.Document) { js.SetTitle("Main Page") js.SetBody(html.Div().Children( html.H1().Id(h1Id).Text("Click Me"), html.A().Href(paths.second).Text("Second page"), )) h1 := document.QuerySelector(h1Id.Selector()) h1.AddEventListener("click", true, func(event dom.Event) { js.NavigateTo(paths.second) }) }
func mainPage(document dom.Document) { js.SetBody(mainView()) //TODO fix this //document.IncludeBootstrapCdn() //document.IncludeBootstrapJsCdn() addClick(exampleButton, func(dom.Event) { sentence := "私がこの世でいちばん好きな場所は台所だと思う。" log.Println("Setting") setValue(textInput, sentence) // processText(document) }) // document.JQuery(processButton).Click(func() { // processText(document) // }) // setupUpdater(document) }
func mainPage(document dom.Document) { js.SetTitle("Main Page") js.SetBody(html.Div().Children( html.H1().Text("Hello world"), )) }