老师您好!事例中的数据都是写死的,是要用参数传进去吗?我这样试了一下,函数没执行,不知道哪里出错了,帮忙看看
function sendJsonString(val){
var result = sendAjaxJSON(val,"json.htm","",false);
document.getElementById("p1").innerHTML=result;
}
网页代码:
dim val as string = "{"name":"李云龙","age":"36"}"
Dim wb As New weui
wb.AddForm("","form1","test.htm")
With wb.AddButtonGroup("form1","btg1",True) '垂直排列
.Add("btn2", "发送jason字符串","button").Attribute="o nclick='sendJsonString(val)'"
End
With
wb.AppendHTML("<div
id='p1' style='margin:0.5em'></div>") '插入一个div,用于显示服务器返回的数据
wb.AppendHTML("<script
src='./lib/ajaxform.js'></script>") '引入脚本文件
e.WriteString(wb.Build)