// HTTP_REFERER 是定義在http protocol的標頭資訊,若非來自非同步的request,值為null
// REMOTE_ADDR 來源IP
// 感謝克里斯大大提供
string referer = Request.ServerVariables["HTTP_REFERER"];
string remoteAddr = Request.ServerVariables["REMOTE_ADDR"];
if((referer != null && referer.IndexOf("163.29.7.165") > -1) || remoteAddr == "163.29.7.165")
{
//: your content is in here.
}
2011/04/11 更新
string referer = Request.ServerVariables["HTTP_REFERER"];
if (referer == null || referer.IndexOf("your domain") == -1)
{
Response.Write("不允許非來自ShowTaiwan網域的存取");
return ;
}
//適用於非同步ajax request的情況,防君子不防小人
2010年10月4日 星期一
2010年5月3日 星期一
jQuery Draggable div
jQuery 現在也有一些公司 host 檔案供大家直接使用
so-called Content delivery network 像是Google
工作緣故需要測試拖曳一個div中包transparent flash的功能
參考資料:
UI/API/1.8/Draggable
so-called Content delivery network 像是Google
工作緣故需要測試拖曳一個div中包transparent flash的功能
< link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css" rel="stylesheet" type="text/css"/>
< script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js">
< script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js">
< script>
$(document).ready(function() {
$("#draggable").draggable();
});
< / script>
參考資料:
UI/API/1.8/Draggable
訂閱:
文章 (Atom)