日期:2014-05-18 浏览次数:20771 次
<script type="text/javascript">
function query(){
var enterSourceKind = $("#enterSourceKind").val()
var orgId = $("#orgId").val();
var year = $("#year").val();
document.getElementById("control1").style.display="none";
document.getElementById("control2").style.display="";
$("#preview").attr("src","<%=path%>/stat/coll/Statistics!queryForPercent.action?enterSourceKind="+enterSourceKind+"&orgId="+orgId+"&year="+year);
if(isSuc!=null){
document.getElementById("control2").style.display="none";
document.getElementById("control1").style.display="";
}
}
// 用ajax吧,当然用相关框架更方便
<script type="text/javascript">
function btn_click() {
//创建XMLHttpRequest对象
var xmlHttp = new XMLHttpRequest();
//获取值
var username = document.getElementById("txt_username").value;
var age = document.getElementById("txt_age").value;
//配置XMLHttpRequest对象
xmlHttp.open("get", "Get.aspx?username=" + username
+ "&age=" + age);
//设置回调函数
xmlHttp.onreadystatechange = function () {
if (xmlHttp.readyState == 4 && xmlHttp.status == 200) {
document.getElementById("result").innerHTML = xmlHttp.responseText;