简体   繁体   English

服务器更改了HiddenField javascript值,请在客户端进行确认

[英]HiddenField javascript value chanded from server confirm on client side

Is there a way to check on client side that the HiddenField has been update from server? 有没有一种方法可以在客户端检查是否已从服务器更新HiddenField

Updating 2 images every 5 second by client side: 客户端每5秒更新2张图片:

 __doPostBack('UpdatePanel', '');

Server side: 服务器端:

 HiddenField1_Foto.Value = Foto(random)

Client side: 客户端:

image.src = document.getElementById('<%= HiddenField1_Foto.ClientID %>').value;

A lot of time a new image doesnt show up like hasnot been load yet,but the server did update document.getElementById('<%= HiddenField1_Foto.ClientID %>').value; 很多时候,没有显示新图像,例如尚未加载,但是服务器确实更新了document.getElementById('<%= HiddenField1_Foto.ClientID %>').value;

How to check that the images has been load? 如何检查图像是否已加载?

image.onload = function(){}-完成了工作

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM