jquery觸發ajax 的error
[
2008/03/24 13:49 | by Else ]
2008/03/24 13:49 | by Else ]
ajax那裡有個屬性,是error時候出現的,
但沒有權限的時候要觸發error怎麼辦呢
讓dom ,或是返回為空
當 session("admin")=1的時候不會出錯,沒有管理權限的時候,就會觸發ajax
但沒有權限的時候要觸發error怎麼辦呢
讓dom ,或是返回為空
if session("admin")=1 then
code
end if
code
end if
if then
response.write "ok"
else
response.write
end fi
response.write "ok"
else
response.write
end fi
當 session("admin")=1的時候不會出錯,沒有管理權限的時候,就會觸發ajax
不在被 CreateParameter 的參數數字忽悠
[
2008/03/19 11:07 | by Else ]
2008/03/19 11:07 | by Else ]
MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param1", 201, 1, 50, Request.Form("id")) ' adLongVarChar
ADODB.Command
[
2008/03/17 14:20 | by Else ]
2008/03/17 14:20 | by Else ]
Set rslist_cmd = Server.CreateObject ("ADODB.Command")
<%
' *** Delete Record: construct a sql delete statement and execute it
If (CStr(Request("act")) = "del") Then
' execute the delete
Set MM_delCmd = Server.CreateObject ("ADODB.Command")
MM_delCmd.ActiveConnection = MM_conn_STRING
MM_delCmd.CommandText = "DELETE FROM dbo.jpcusertable WHERE id = ?"
MM_delCmd.Parameters.Append MM_delCmd.CreateParameter("param1", 5, 1, -1, Request.QueryString("id")) ' adDouble
MM_delCmd.Execute
MM_delCmd.ActiveConnection.Close
' append the query string to the redirect URL
Response.Redirect("client.asp")
End If
%>
' *** Delete Record: construct a sql delete statement and execute it
If (CStr(Request("act")) = "del") Then
' execute the delete
Set MM_delCmd = Server.CreateObject ("ADODB.Command")
MM_delCmd.ActiveConnection = MM_conn_STRING
MM_delCmd.CommandText = "DELETE FROM dbo.jpcusertable WHERE id = ?"
MM_delCmd.Parameters.Append MM_delCmd.CreateParameter("param1", 5, 1, -1, Request.QueryString("id")) ' adDouble
MM_delCmd.Execute
MM_delCmd.ActiveConnection.Close
' append the query string to the redirect URL
Response.Redirect("client.asp")
End If
%>
getElementById getElementsByName getElementsByTagName 的用法与区别
[
2008/03/15 22:10 | by Else ]
2008/03/15 22:10 | by Else ]
语法: document.getElementById(id)
参数:id :必选项为字符串(String)
返回值:对象;
返回相同id对象中的第一个,如果无符合条件的对象,则返回 null
example:document.getElementById("id1").value;
getElementsByName:
语法: document.getElementsByName(name)
参数:name :必选项为字符串(String)
返回值:数组对象; 如果无符合条件的对象,则返回空数组
example:
document.getElementsByName("name1")[0].value;
document.getElementsByName("name1")[1].value;
getElementsByTagName:
语法: object.getElementsByTagName(tagname) object可以是document或event.srcElement.parentElement等
参数:tagname:必选项为字符串(String)
返回值:数组对象; 如果无符合条件的对象,则返回空数组
example:
document.getElementsByTagName("p")[0].childNodes[0].nodeValue;
document.getElementsByTagName("p")[1].childNodes[0].nodeValue;
参数:id :必选项为字符串(String)
返回值:对象;
返回相同id对象中的第一个,如果无符合条件的对象,则返回 null
example:document.getElementById("id1").value;
getElementsByName:
语法: document.getElementsByName(name)
参数:name :必选项为字符串(String)
返回值:数组对象; 如果无符合条件的对象,则返回空数组
example:
document.getElementsByName("name1")[0].value;
document.getElementsByName("name1")[1].value;
getElementsByTagName:
语法: object.getElementsByTagName(tagname) object可以是document或event.srcElement.parentElement等
参数:tagname:必选项为字符串(String)
返回值:数组对象; 如果无符合条件的对象,则返回空数组
example:
document.getElementsByTagName("p")[0].childNodes[0].nodeValue;
document.getElementsByTagName("p")[1].childNodes[0].nodeValue;
sql 的null问题,记录一下
[
2008/03/12 14:59 | by Else ]
2008/03/12 14:59 | by Else ]
SELECT * FROM ruby WHERE abc = ? and (efg>=? or efg is null) ORDER BY newsId DESC
把大于等于efg的记录和egf为空的记录输出来,在与abc相并的条件,
asp 的dw生成的代码,不在看不懂,
[
2008/03/11 17:15 | by Else ]
2008/03/11 17:15 | by Else ]
<%
Dim news_rs__MMColParam
news_rs__MMColParam = "1"
If (Session("num") <> "") Then
news_rs__MMColParam = Session("num")
End If
%>
<%
Dim news_rs
Dim news_rs_cmd
Dim news_rs_numRows
Set news_rs_cmd = Server.CreateObject ("ADODB.Command")
news_rs_cmd.ActiveConnection = MM_conn_STRING
news_rs_cmd.CommandText = "SELECT * FROM dbo.ruby WHERE num = ? ORDER BY newsId DESC"
news_rs_cmd.Prepared = true
news_rs_cmd.Parameters.Append news_rs_cmd.CreateParameter("param1", 200, 1, 100, news_rs__MMColParam) ' adVarChar
Set news_rs = news_rs_cmd.Execute
news_rs_numRows = 0
%>
Dim news_rs__MMColParam
news_rs__MMColParam = "1"
If (Session("num") <> "") Then
news_rs__MMColParam = Session("num")
End If
%>
<%
Dim news_rs
Dim news_rs_cmd
Dim news_rs_numRows
Set news_rs_cmd = Server.CreateObject ("ADODB.Command")
news_rs_cmd.ActiveConnection = MM_conn_STRING
news_rs_cmd.CommandText = "SELECT * FROM dbo.ruby WHERE num = ? ORDER BY newsId DESC"
news_rs_cmd.Prepared = true
news_rs_cmd.Parameters.Append news_rs_cmd.CreateParameter("param1", 200, 1, 100, news_rs__MMColParam) ' adVarChar
Set news_rs = news_rs_cmd.Execute
news_rs_numRows = 0
%>
记得以前刚刚接触的时候,有点看不懂,但现在喜欢上这样的一个格式,时间上有很大上升的空间,
现在机子好一点,将会学到更多!
编程的机子,也不会是垃圾的机子
asp关于 utf-8的问题,
[
2008/03/11 17:11 | by Else ]
2008/03/11 17:11 | by Else ]
试了几个,下面的是我比较喜欢的
在限制session的时候,这个还是比较方便 的
这样可以确保提示的非英文不是乱码
php方面就是header了,
最近回去,好像是位子不是很好,所以都没有写些什么了
在限制session的时候,这个还是比较方便 的
response.Charset="utf-8"
这样可以确保提示的非英文不是乱码
php方面就是header了,
最近回去,好像是位子不是很好,所以都没有写些什么了
像 word表格一樣的html代碼
[
2008/03/10 15:37 | by Else ]
2008/03/10 15:37 | by Else ]
<table width="200"border="1" align="center" cellpadding="3" cellspacing="0" bordercolorlight="#330066" bordercolordark="#FFFFFF">
<tr>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
</tr>
</table>
<tr>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
</tr>
</table>
像word的細線表格吧,!
frameset, iframe, frame框架页面出现横向滚动条bug的隐藏方法
[
2008/03/10 13:54 | by Else ]
2008/03/10 13:54 | by Else ]
使用框架(无论是frameset、frame、iframe)嵌套网页的时候,如果子网页的高度超过了预先设定的高度,会出现滚动条,也就是尺寸溢出,一般来说如果高度超了就出现垂直滚动条,宽度超了就出现水平滚动条,但是在IE6中,只要尺寸大于等于预定高度,就会两个滚动条一起出现,这好象是一个bug。
解决方法:
在子网页设置css如下:
html {
overflow-y:auto!important;
*overflow-y:scroll;
}
这段最重要的一点是设置overflow-y为scroll,这样强制出现垂直滚动条的话,水平滚动条就不会显示出来了,但如果宽度超出过多,水平滚动条还是会超出,这时可以考虑设置:overflow-x:hidden;,但相应的,这样用户就无法滚动子页面了。
之所以要加overflow-y:auto!important;,是因为IE7中已没有这个bug,并且firefox也能认到overflow-y这个据说是IE的私有属性……,所以我们还要把overflow设回来。
主页面加IFRAME SCROLLING="YES"
子页面
程序代码
'让竖条消失:
'让横条消失:
'还要去掉
'子页面里的
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
'两个都去掉
<IFRAME scrolling="no"
解决方法:
在子网页设置css如下:
html {
overflow-y:auto!important;
*overflow-y:scroll;
}
这段最重要的一点是设置overflow-y为scroll,这样强制出现垂直滚动条的话,水平滚动条就不会显示出来了,但如果宽度超出过多,水平滚动条还是会超出,这时可以考虑设置:overflow-x:hidden;,但相应的,这样用户就无法滚动子页面了。
之所以要加overflow-y:auto!important;,是因为IE7中已没有这个bug,并且firefox也能认到overflow-y这个据说是IE的私有属性……,所以我们还要把overflow设回来。
主页面加IFRAME SCROLLING="YES"
子页面
程序代码
'让竖条消失:
<BODY STYLE='OVERFLOW:SCROLL;OVERFLOW-Y:HIDDEN'>
</BODY>
</BODY>
'让横条消失:
<BODY STYLE='OVERFLOW:SCROLL;OVERFLOW-X:HIDDEN'>
</BODY>
</BODY>
'还要去掉
'子页面里的
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
'两个都去掉
<IFRAME scrolling="no"
只能輸入小數點的測試
[
2008/02/22 14:09 | by Else ]
2008/02/22 14:09 | by Else ]
if (!Char.IsNumber(e.KeyChar) && !Char.IsPunctuation(e.KeyChar) && !Char.IsControl(e.KeyChar))
{
e.Handled = true;
}
else if (Char.IsPunctuation(e.KeyChar))
{
if (e.KeyChar == '.')
{
if (((TextBox)sender).Text.LastIndexOf('.') != -1)
{
e.Handled = true;
}
}
else
{
e.Handled = true;
}
}














