-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjs.go
35 lines (27 loc) · 907 Bytes
/
js.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
package objhtml
import (
"fmt"
"golang.org/x/net/html"
)
func JqFuncCont(textinner string) string {
//return html.EscapeString(fmt.Sprintf(`$(function(){%s});`, textinner))
return fmt.Sprintf(`$(function(){%s});`, textinner)
}
func JqIdPropCont(id, property, textinner string) string {
//return html.EscapeString(fmt.Sprintf(`$('#%s').%s({%s});`, id, property, textinner))
return fmt.Sprintf(`$("#%s").%s(%s);`, id, property, textinner)
}
func JqIdProp(id, property string) string {
return html.EscapeString(fmt.Sprintf(`$("#%s").%s`, id, property))
}
func JsAlert(alert string) string {
return html.EscapeString(fmt.Sprintf("alert("+html.EscapeString(alert)+");", alert))
}
//NewJs send function
func JsSendFunc(send func()) {
//events <- Event(clientid, nil, nil, send, nil, nil)
}
//NewJs send data
func JsSendJson(json string) {
//events <- Event(clientid, nil, nil, send, nil, nil)
}