I believe that everyone has encountered such a situation, instant sending short messages in the system of B / S, the general method is the timing refresh page, but if you are tired of non-flashing pages, you may wish to come. Try the solution to JavaScript WebService. // deptCode is the department number to detect if there is an unread information Function Monimsg (deptcode) {var deptcode = document.getElementByid ("deptcode"). Value; var mywebservice = "http://122124.6.70/khmis/websvr / Kkh_msg.asmx "; var mymethod =" http://tempuri.org/hasnewmsg ";
Var RequestHttp = New ActiveXObject ("Microsoft.xmlhttp"); var s = ""; s = s " XML Version = /" 1.0 / "encoding = /" GB2312 / "?> / n" s = s " / N "s = s " / N "; // ------------ Write input parameters ------------------------- ---------------------- S = S / n "; s = S "" deptcode " deptcode> / n"; s = s " hasnewmsg> / n"; // ---------------- -------------------------------------------------- ----- S = S soap: body> / n "s = s " soap: envelope> "// This is a focus! requestHttp.Open ( "POST", myWebService, false); requestHttp.SetRequestheader ( "Content-Type", "text / xml; Charset = gb2312"); requestHttp.SetRequestheader ( "SOAPAction", myMethod); requestHttp.Send (s ); Res = requesthttp.responsexml; var pos1 = res. xml.indexof (""); var pos2 = res. xml.indexof (" hasnewmsgresult>"); var len = POS2 - POS1 - (" "). Length; var result = res. xml.substr (POS1 (" "). Length, len); if (Document.getElementByid (" ishashistorymsg "). Value =="