<script>

$(document).ready(function () {
<%
string dqsj = System.DateTime.Now.ToString("yyyy-MM-dd");
%>
seach();

});
var shuju = "";
var sj = "";
function se()
{
seach();
}
function seach() {
$(function () {
var strTady = $("#txtCxsj").val();
$.ajax({
async: false,
type: "POST",
url: "/qbjl/dqwdxx?strTady=" + strTady,
dataType: 'json',
success: function (data) {
shuju = data.rows;
sj = data.rows1;
}
});
$('#container').highcharts({
chart: {
zoomType: 'xy',
plotBackgroundImage: '/Yxjc/xml/themebg.png',
backgroundColor: '#e9ecef'
},
credits: {
enabled: false // 禁用版权信息
},
title: {
text: '大气温度数据展示'
},
xAxis: [{
categories: eval(sj)
}],
yAxis: [
{ // Secondary yAxis
gridLineWidth: 0,
title: {
text: '大气温度',
style: {
color: Highcharts.getOptions().colors[0]
}
},
labels: {
format: '{value} ℃',
style: {
color: Highcharts.getOptions().colors[0]
}
}

}
],
tooltip: {
shared: true
},
legend: {
layout: 'vertical',
align: 'center',
x: 350,
verticalAlign: 'top',
y: 15,
floating: true,
backgroundColor: (Highcharts.theme && Highcharts.theme.legendBackgroundColor) || '#FFFFFF'
},

series: [{

name: '大气温度',
data: eval(shuju)

}]

});
});
}
function IsTady() {
strTady = $("#txtCxsj").val();
var strsj = new Date();
var strrq = strsj.format("yyyy-MM-dd");
if (strTady != "") {
if (strTady < strrq) {
$("#NextBtn").show();
}
else {
$("#NextBtn").hide();
}
}
}
function BackDay() {
strTady = $("#txtCxsj").val();
if (strTady != "") {
var day = new Date(Date.parse(strTady.replace(/-/g, '/')));
day.setDate(day.getDate() - 1);

$("#txtCxsj").val(day.format("yyyy-MM-dd"));
seach();
}
else {
alert("查询日期不能为空");
}

}
function NextDay() {
strTady = $("#txtCxsj").val();
if (strTady != "") {
var day = new Date(Date.parse(strTady.replace(/-/g, '/')));
day.setDate(day.getDate() + 1);
$("#txtCxsj").val(day.format("yyyy-MM-dd"));
seach();
}
else {
alert("查询日期不能为空");
}
}

Date.prototype.format = function (format) {
var o = {
"M+": this.getMonth() + 1,
"d+": this.getDate(),
"h+": this.getHours(),
"m+": this.getMinutes(),
"s+": this.getSeconds(),
"q+": Math.floor((this.getMonth() + 3) / 3),
"S": this.getMilliseconds()
}
if (/(y+)/.test(format)) {
format = format.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length));
}
for (var k in o) {
if (new RegExp("(" + k + ")").test(format)) {
format = format.replace(RegExp.$1, RegExp.$1.length == 1 ? o[k] : ("00" + o[k]).substr(("" + o[k]).length));
}
}
return format;
}
</script>
<div class="box2" paneltitle="选择指针喷灌机" id="searchPanel">
<form action="" id="queryForm" method="post">
<input type="hidden" id="parentId" name="parentId" value="1" />
<table cellpadding="0" cellspacing="0" width="100%" class="table">
<tr>
<td class="ti_blue" width="70" style="text-align: right">查询日期:
</td>
<td width="150">

<input type="text" class="date" id="txtCxsj" datefmt="yyyy-MM-dd" name="gcjcxx.jcny" onpropertychange="IsTady()" value="<%=dqsj%>" />

</td>
<td class="ti_blue" width="220" style="text-align: left">

<button type="button" onclick="BackDay()"><span class="icon_find">上一天</span></button>&nbsp;
<button type="button" onclick="NextDay()" id="NextBtn" style="display: none"><span class="icon_find">下一天</span></button>
</td>
<td align="right" style="padding-right: 10px">

<button type="button" onclick="se()"><span class="icon_find">查询</span></button>
</td>
</tr>
</table>
</form>
</div>
<div style="border:solid 1px #bcf5f5">
<div id="container" style="min-width:700px;height:400px;"></div>
</div>
<div style="height:0px; width:100%;"></div>

ajax 异步调用把返回值赋给一个全局变量的用法,最主要的就是把async属性改为 false,的更多相关文章

  1. JavaScript 函数——语法,调用,返回值,局部变量,全局变量,未声明变量

    JavaScript 函数是被设计为执行特定任务的代码块. JavaScript 函数会在某代码调用它时被执行. ㈠函数 ⑴什么是函数 函数是由事件驱动的或者当它被调用时执行的可重复使用的代码块. ⑵ ...

  2. jquery ajax异步调用

    写程序的第一步都要知其然,至于知其所以然就要看个人的爱好了.下面说一下web开发中经常用的ajax. 这里是用的jquery框架实现的ajax异步调用.废话少说先上代码.(asp.net开发) var ...

  3. 获取的ajax方法return的返回值的问题解析

    今天刚上班就偶遇关于获取Ajax方法return的返回值的问题,这里小记一下. 在使用jquery中,如果获取不到ajax返回值,原因有二: 一.ajax未使用同步 ajax未使用同步,导致数据未加载 ...

  4. shell调用函数返回值深入分析

    编写shell脚本过程中,我们经常会自定义一些函数,并根据函数的返回值不同来执行相应的流程,那么我们如何来获取函数的返回值呢? 首先shell中调用函数有两种方式: 第一种:value=`functi ...

  5. jquery中ajax异步调用接口

    之前写过一个原始的.无封装的页面,没有引入任何外部js,直接实例化Ajax的XmlRequest对象去异步调用接口,参见Ajax异步调用http接口后刷新页面,可对比一下. 现在我们用jquery包装 ...

  6. jquery的ajax异步请求接收返回json数据

    http://www.jb51.net/article/51122.htm jquery的ajax异步请求接收返回json数据方法设置简单,一个是服务器处理程序是返回json数据,另一种就是ajax发 ...

  7. getchar()函数的返回值赋给char型,用if(ch=getchar() != EOF)测试,输入ctrl+z同样可以结束循环的分析

    2013-07-18 21:35:58 getchar()函数的返回值赋给char型,用if(ch=getchar() != EOF)测试,输入ctrl+z同样可以结束循环的分析. char是字符型数 ...

  8. 获取JavaScript异步函数的返回值

    今天研究一个小问题: 怎么拿到JavaScript异步函数的返回值? 1.错误尝试 当年未入行时,我的最初尝试: ? 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 <s ...

  9. Shell $?获取函数返回值或者上一个命令的退出状态

    Shell $?获取函数返回值或者上一个命令的退出状态 来自:互联网 时间:2021-01-12 阅读:2 $? 是一个特殊变量,用来获取上一个命令的退出状态,或者上一个函数的返回值. 所谓退出状态, ...

随机推荐

  1. 文件浏览器及数码相框 -2.3.2-freetype_arm-2

    显示多行文字 两行文字左边对齐 简单使用两个循环显示两行字体 根据上一行字体的宽度来进行下一行左边的计算 #include <sys/mman.h> #include <sys/ty ...

  2. soap

    sudo apt-get update apt-get install php-soapphp-config --configure-options --enable-soap php -i | gr ...

  3. cmd的xcopy命令

    C#项目的PostEvent里经常会用到xcopy命令,复制目录时容易出错,如下: xcopy sourceDir targetDir,其中的2个目录最后不能有反斜杠"",而目录类 ...

  4. 《算法竞赛入门经典》5.12TeX括号

    /* *在TeX中,左双引号是``,右双引号是''.输入一篇包含双引号的文章,你的任务是把它转换成TeX的格式. *样例输入:"To be or not to be,"quoth ...

  5. wp8.1 Study11:APP里文件读写和使用XML和Json序列化

    一.文件读写 1.基本操作(使用FileIO API) 这个方法在上一个stduy已经学过,那么贴出来复习下,代码如下: private async void writeTextToLocalStor ...

  6. 从协议VersionedProtocol开始1

    Phase 0: Make a plan You must first decide what steps you're going to have in your process. It sound ...

  7. poj1647

    转自:http://woodjohn.blog.sohu.com/231905679.html 题意是比较简单的:假定你是国际象棋中的白方,现在棋盘上只剩下白王.黑王和白后(王和后的走法规则就不赘述了 ...

  8. <矩阵的基本操作:矩阵相加,矩阵相乘,矩阵转置>

    //矩阵的基本操作:矩阵相加,矩阵相乘,矩阵转置 #include<stdio.h> #include<stdlib.h> #define M 2 #define N 3 #d ...

  9. PAT 06-2 字符串字母大小写转换

    没什么好说的,记得使用ctype.h就好了,谭浩强那本书就介绍了,再不使用就太对不起他老人家了:有一点小小的地方需要注意一下,&&的优先级比=号高,所以getchar()两边没有括号的 ...

  10. SingleThreadModel is deprecated in Servlet API version 2.4

    Ensures that servlets handle only one request at a time. This interface has no methods. If a servlet ...