以文本方式查看主题 - Foxtable(狐表) (http://foxtable.net/bbs/index.asp) -- 专家坐堂 (http://foxtable.net/bbs/list.asp?boardid=2) ---- sendAjaxJSON 问题 (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=184047) |
-- 作者:304376480 -- 发布时间:2022/11/23 11:31:00 -- sendAjaxJSON 问题 老师您好!事例中的数据都是写死的,是要用参数传进去吗?我这样试了一下,函数没执行,不知道哪里出错了,帮忙看看 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) |
-- 作者:有点蓝 -- 发布时间:2022/11/23 11:48:00 -- .Add("btn2", "发送jason字符串","button").Attribute="onclick=\'sendJsonString(""" & val & """)\'" |