臺灣行政區下拉式選單( jQuery base )
使用jQuery 動態產生 臺灣行政區下拉式選單
...... Reading MoreJavascript 字串的擴充 functions
一些 Javascript 的 String 擴充功能:
Substr
myVar = substr2(myVar, x, y); //Your function
myVar = myVar.substr(x, y); //built-in function
Trim
String.prototype.trim = function(){return
(this.replace(/^[\s\xA0]+/, “”).replace(/[\s\xA0]+$/, “”))}
startsWith
String.prototype.startsWith = function(str)
{return (this.match(“^”+str)==str)}
endsWith
String.prototype.endsWith = function(str)
{return (this.match(str+”$”)==str)}
Examples:
var myStr = “ Earth is a beautiful planet ”;
var myStr2 = myStr.trim();
//==“Earth is a beautiful planet”;
if (myStr2.startsWith(“Earth”)) // returns TRUE
if (myStr2.endsWith(“planet”)) // returns TRUE
if (myStr.startsWith(“Earth”))
// returns FALSE due to the leading spaces…
if [...]
Simple Image Gallery (jQuery Base)
簡單的 Image Gallary
IE 6.0 支援 PNG (jQuery Base)
IE 6跑PNG
...... Reading MoreCSS系統字參考
CKEditor 的 ToolBar 的快速設定
CKEditor 真是好用
快速設定法:
<script type=”text/javascript”>
CKEDITOR.config.toolbar_XXXXX =
[
['NewPage', 'Preview'],
['Cut', 'Copy', 'Paste', 'PasteText', 'PasteFromWord', '-', 'Scayt'],
['Undo', 'Redo', '-', 'Find', 'Replace', '-', 'SelectAll', 'RemoveFormat'],
['Image', 'Flash', 'Table', 'HorizontalRule', 'Smiley', 'SpecialChar', 'PageBreak'],
‘/’,
['Styles', 'Format'],
['Bold', 'Italic', 'Strike'],
['NumberedList', 'BulletedList', '-', 'Outdent', 'Indent', 'Blockquote'],
['Link', 'Unlink', 'Anchor'],
['Maximize', '-', 'About']
];
CKEDITOR.replace(‘Content_3′,
{
toolbar: ‘XXXXX’
[...]
ASP.NET 直接寫出檔案, 並該使用者跳出下載對話框
Response.AppendHeader(“Content-Disposition”, “attachment; filename=” & Server.UrlPathEncode(Filename))
Response.TransmitFile(PathAndFilename)
Filename 記得要用 UrlPathEncode.
附註寫出直接寫出圖檔的方式, 沒測試過, 有空再來試試. 其中 bmp 是 BMP 物件.
Response.ContentType = “image/jpeg”;
Response.AppendHeader(“Content-Disposition”,“attachment; filename=LeftCorner.jpg”);
bmp.Save(Response.OutputStream, ImageFormat.Jpeg);
參考網站 http://www.west-wind.com/weblog/posts/76293.aspx
ASP.NET Constant
以前用PHP常數大部份都會訂一頁專門存變數
換到ASP.NET就把我搞的一頭霧水
IE & Firefox getYear() 共用Function
Firefox 和 IE Date物件的 getYear的定義不同
Firefox取得會比IE少1900