方法1,刷新整个页面
方法2,仅刷新图片,这个比较麻烦
假设Photo位于\web目录下
自定义函数:item_getImg()
Dim e As RequestEventArgs = args(0)
Dim wb As New WeUI
Dim sb As New StringBuilder
Dim jo As JO bject = JObject.Parse(e.PlainText)
Dim key As Integer = jo("key")
Dim dr As DataRow = Data Tables("item99").SQLF ind("[_Identify] = " & key)
If dr IsNot Nothing Then
Dim jo As New JObject
jo("li") = CExp("<li data-gid='imgid_gallery' data-image='./Photo/{0}' class='weui_uploader_file' style='background-image:url(./Photo/{0})'></li>",dr("img01"))
jo("ga") = CExp("./Photo/{0}",dr("img01"))
e.WriteString(jo.ToString) 'dr("img01") 列中装的多个文件名称
End If
JS函数:po_view8()
function po_view8(){
var obj = new Object();
obj.key=table2.primarykey;
var result = sendAjaxJSON(obj,"item_getImg.htm","",false);
alert(result); //测试结果有值(图片名称)
if (result){
var pics = val('(' + result + ')');
document.getElementById("imgid_thumbnails").innerHTML = pics.li;
document.getElementById("imgid_gallery").setAttribute("data-images",pics.ga);
}
}
具体可以参考实例:http://wechat.foxtable.com:9009/WebHelp/scr/we0130.htm,里库存查询的例子