HrmTools_wev8.js
797 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
/**
* @author wcd
* @date 2014-06-18
*/
function ajaxinit(){
var xmlhttp;
try{
xmlhttp = new ActiveXObject('Msxm12.XMLHTTP');
}catch(e){
try{
xmlhttp = new ActiveXObject('Microsoft.XMLHTTP');
}catch(e){
try{
xmlhttp = new XMLHttpRequest();
}catch(e){}
}
}
return xmlhttp;
}
function ajaxSubmit(url){
var result = "";
var xmlhttp = ajaxinit();
xmlhttp.open("get",url,false);
xmlhttp.onreadystatechange = function(){
if(xmlhttp.readyState == 4){
if(xmlhttp.status == 200){
result = xmlhttp.responseText;
}
}
}
xmlhttp.send(null);
return result.trim();
}
function changeSelectValue(id,value){
var option = $("select[id="+id+"]").find("option[value="+value+"]");
$("select[id="+id+"]").selectbox("change", option.attr('value'), option.html());
}