http://www.w3schools.com/tags/ref_httpmethods.asp
- GET requests can be cached
- POST requests are never cached
//取最同一層元素
$('#flow')[0].innerHTML = "contents";
//取得上一層元素 (window通常可省略,e.g., window.parent.document)
$('#flow', parent.document)[0].innerHTML = "contents";
//取得最上層元素
$('#flow', top.document)[0].innerHTML = "contents";
<%@ WebHandler Language="C#" Class="Handler" %>
using System;
using System.Web;
using System.Web.SessionState;
using System.Collections.Generic;
public class Handler : IHttpHandler,IReadOnlySessionState {
public void ProcessRequest (HttpContext context) {
List listHD = new List();
listHD.Add("[\"/Date(1325433600000)/\"]");
listHD.Add("[\"/Date(1325520000000)/\"]");
listHD.Add("[\"/Date(1325692800000)/\"]");
context.Response.ContentType = "application/json";
context.Response.Charset = "utf-8";
context.Response.Write(new System.Web.Script.Serialization.JavaScriptSerializer().Serialize(listHD));
}
public bool IsReusable {
get {
return false;
}
}
}
$.ajax({
type: 'post',
async: false,
url: "Handler.ashx",
dataType: "json",
contentType: 'application/json; charset=utf-8',
success: function (result) {
hd = result;
},
error: function () {
hd = '';
alert('讀取假日資料錯誤!');
}
})
<script src="js/getHD.js" type="text/javascript"></script>
$(function() {
$(".gantt").gantt({
holidays: hd,
...
}
If IsDate(chk_cash_date_1.Text) <> True Then
Label4.Text = "日期格式錯誤!"
Exit Sub
End If
Dim date_list() As String
date_list = chk_cash_date_1.Text.Split("/")
If date_list.Count <> 3 Then
ScriptManager.RegisterStartupScript(UpdatePanel1, UpdatePanel1.GetType(), "date_error1", "alert('日期格式錯誤!');", True)
Exit Sub
End If
強制改成 yyyy/MM/dd 格式
Dim year_tmp As String
Dim month_tmp As String
Dim date_tmp As String
year_tmp = String.Format("{0:0000}", Convert.ToInt16(date_list(0)))
month_tmp = String.Format("{0:00}", Convert.ToInt16(date_list(1)))
date_tmp = String.Format("{0:00}", Convert.ToInt16(date_list(2)))
Dim merg_date As String = year_tmp + "/" + month_tmp + "/" + date_tmp
function upload1() {
var cust_no = document.getElementById("Label10");
returnValue = window.showModalDialog("../E_upload/upload_1.aspx", cust_no.innerText, "dialogWidth=450px;dialogHeight=350px");
}
jQuery(document).ready(function() {
var tmp = window.dialogArguments;
//mail_no
var hidden1 = document.getElementById("hidden1");
//rfq_no
var hidden2 = document.getElementById("hidden2");
var tmparray = tmp.split(",");
var hidden3 = document.getElementById("hidden3");
hidden1.value = tmparray[0];
hidden2.value = tmparray[1];
if (hidden3.value != "load") {
hidden3.value = "load";
__doPostBack('LinkButton2', '');
}
});
$("#ctl00_ContentPlaceHolder1_TextBox8").autocomplete('Return_B.aspx?q=a',
{
delay: 200,
highlight: false,
multiple: true,
multipleSeparator: " ",
scroll: true,
scrollHeight: 300
});
改成:
$("#ctl00_ContentPlaceHolder1_TextBox8").live("keypress",function(){
$(this).autocomplete('Return_B.aspx?q=a',
{
delay: 200,
highlight: false,
multiple: true,
multipleSeparator: " ",
scroll: true,
scrollHeight: 300,
});
});
使用live()綁定之後雖然自動完成有反應,
不過每次自動搜尋出結果後,
又回來初始的搜尋結果,
只好暫時先把這個畫面的UpdatePanel拿掉,
再找辦法解決