Archive for February, 2010
臺灣行政區下拉式選單( jQuery base )
使用jQuery 動態產生 臺灣行政區下拉式選單
Javascript 字串的擴充 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
CSS系統字參考