星期四, 9月 01, 2011
jquery plugin (3)
jsTree: 做樹狀圖的plugin,有點複雜不過功能很齊全,支援ajax、crrm等
http://www.jstree.com/documentation
jquery.hotkey: 熱鍵plugin,可以簡單實現網站上如ctrl+w的自訂功能
https://github.com/jeresig/jquery.hotkeys/blob/master/jquery.hotkeys.js
jquery.cookie
https://github.com/carhartl/jquery-cookie/blob/master/jquery.cookie.js
printf: 在js上提供類似C的printf函式
http://plugins.jquery.com/project/printf
jquery.address: 類似jquery.history,可用簡單的方式實現deep link(ajax的上一頁)
官網文件 : http://www.asual.com/jquery/address/docs/
不錯的中文API: http://julabs.me/blog/front/jquery-plugin-deep-linking-methods/
簡介: http://blog.maxiang.net/jquery-address-for-deep-linking/59/
Tiny Scrollbar : 漂亮的捲軸
http://www.baijs.nl/tinyscrollbar/
附上一個很多分類plugin的網站
http://www.open-open.com/ajax/3_Tree.htm
星期一, 8月 29, 2011
Uncaught Error: can't load XRegExp twice in the same frame
在Chrome上debug會出現 Uncaught Error: can't load XRegExp twice in the same frame 已經不是一天兩天的問題了。然而雖然有警告,程式卻都跑得好好的我也就不管它了XD
今天總算是在這裡查到原因了
Chrome: Uncaught Error: can't load XRegExp twice in the same frame
Question:
The following code will fail in both of my chromes on 2 different computers (Windows 7 both of them, Chrome 12.0.742.100).
<script type="text/javascript">
location.hash = "#one";
location.hash = "#two";
location.hash = "#three";
</script>
I feel like I tried everything. Can anyone confirm this error on chrome, and does anyone have an idea as to how I fix it? Thanks a lot.
Answer:
It works fine with me on Chrome 12.0.742.100 on Win7. I'm assuming you have installed extensions? disable all extensions (or go to incognito mode) and try to load your page again. Errors from content scripts are also displayed in the javascript console. If you are not using XRegExp on your page, probably one of the extensions does.
Edit:
The source of the exception should be located to the right. Click it to go to the script that caused the exception.
Report:
I have no clue how I cannot have thought of this. You were completely correct, it was the chrome extension "XML Viewer". Thanks.
結論就是:
很有可能是因為chrome的某些plugin造成的問題,而且使用者那邊裝什麼plugin我們也管不著
既然束手無策而且也不會造成crash,就繼續不管它囉
今天總算是在這裡查到原因了
Chrome: Uncaught Error: can't load XRegExp twice in the same frame
Question:
The following code will fail in both of my chromes on 2 different computers (Windows 7 both of them, Chrome 12.0.742.100).
<script type="text/javascript">
location.hash = "#one";
location.hash = "#two";
location.hash = "#three";
</script>
I feel like I tried everything. Can anyone confirm this error on chrome, and does anyone have an idea as to how I fix it? Thanks a lot.
Answer:
It works fine with me on Chrome 12.0.742.100 on Win7. I'm assuming you have installed extensions? disable all extensions (or go to incognito mode) and try to load your page again. Errors from content scripts are also displayed in the javascript console. If you are not using XRegExp on your page, probably one of the extensions does.
Edit:
The source of the exception should be located to the right. Click it to go to the script that caused the exception.
Report:
I have no clue how I cannot have thought of this. You were completely correct, it was the chrome extension "XML Viewer". Thanks.
結論就是:
很有可能是因為chrome的某些plugin造成的問題,而且使用者那邊裝什麼plugin我們也管不著
既然束手無策而且也不會造成crash,就繼續不管它囉
星期四, 8月 25, 2011
Windows 7 零售版改成適用於KMS的大量授權版 (0xC004C003)
slmgr -ipk FJ82H-XT6CR-J8D7P-XQJJ2-GPDD4
http://changyy.pixnet.net/blog/post/29445461
http://www.askasu.idv.tw/index.php/2009/10/18/736/
KMS Client Setup Keys
http://changyy.pixnet.net/blog/post/29445461
http://www.askasu.idv.tw/index.php/2009/10/18/736/
KMS Client Setup Keys
星期二, 8月 09, 2011
C#內嵌WMP用法
右擊工具箱->選擇項(I)... -> 顯示"選擇工具箱項" -> COM組件 -> Windows Media Player wmp.dll 添加
axWindowsMediaPlayer1.windowlessVideo = false; //設為false後雙擊屏幕可以全屏
axWindowsMediaPlayer1.fullScreen = true; //設播放器全屏播放
axWindowsMediaPlayer1.URL = @"mms://192.168.0.102/vod/jingwei.wma";
axWindowsMediaPlayer1.Ctlcontrols.play(); //播放
axWindowsMediaPlayer1.Ctlcontrols.stop(); //停止
axWindowsMediaPlayer1.Ctlcontrols.pause(); //暫停
axWindowsMediaPlayer1.settings.autoStart = true; //自動播放
axWindowsMediaPlayer1.settings.mute = false; //靜音
axWindowsMediaPlayer1.settings.volume = 100; //音量 int 0 ~ 100 100 是最大音量
axWindowsMediaPlayer1.currentMedia.duration.ToString();//影片長度
axWindowsMediaPlayer1.Ctlcontrols.currentPosition = 30; //當前的播放位置 double
axWindowsMediaPlayer1.currentMedia.getItemInfo("Title");//標題
axWindowsMediaPlayer1.currentMedia.getItemInfo("Author");//作者
//*****************************************************************************//
MediaPlay 以前版本
右擊工具箱->選擇項(I)... -> 顯示"選擇工具箱項" -> COM組件 -> 瀏覽(B)... -> C:WINDOWS\system32\msdxm.ocx -> 打開
Windows Media Player msdxm.dll 添加
label4.Text = axMediaPlayer1.Volume.ToString(); //音量
axMediaPlayer1.FileName = @"mms://218.98.101.164/vod/jingwei.wma";//文件路徑
axMediaPlayer1.Play(); //開始播放
//******************************************************************************//
//****************************************************************************//
右擊工具箱->選擇項(I)... -> 顯示"選擇工具箱項" -> COM組件 -> RealPlayer G2 Control rmoc3260.dll 添加
axRealAudio1.Source = @"F:\mp3\hh.mp3"; //播放路徑
axRealAudio1.CanPlayPause(); //Bool 型是否能暫停
axRealAudio1.CanPause(); //暫停
axRealAudio1.DoPlayPause(); //正在播放的影片暫停播放
axRealAudio1.CanPlay(); //Bool是否能播放
axRealAudio1.DoPlay(); //播放
axRealAudio1.CanStop() //播放是否可以停止
axRealAudio1.DoStop(); //播放停止
axRealAudio1.SetCenter(true); //按影片原大小播放
axRealAudio1.SetFullScreen();//播放器全屏播放影片
int place = axRealAudioP.GetPosition();
axRealAudio1.DoStop();
axRealAudio1.SetCente*(**lse); //拉伸播放 axRealAudio1.SetCenter(true); 按影片原始大小播放
axRealAudio1.DoPlay();
axRealAudio1.SetPosition(place);
nResL = axRealAudio1.GetPosition(); //獲得當前影片 的播放進度
label1.Text = axRealAudio1.GetTitle(); //獲得影片的標題
label2.Text = "當前的帶寬: " + axRealAudio1.GetBandwidthCurrent() / 1024 + "KB";//當前影片的當前的帶寬
label3.Text = "連接的帶寬: " + axRealAudio1.GetConnectionBandwidth() / 1024 + "KB"; //當前的連接的帶寬
參考 http://www.csharpwin.com/csharpspace/9028r9970.shtml
星期二, 7月 26, 2011
如果再ul li用了display:inline-block,li雖然會列成一排,但是li間就會出現空格
一般來說這種列表通常是用float:left達成,不過有些時候用第一個方法會比較靈活
但是要怎麼解決中間有空白呢?
請參考下面:
ul { letter-spacing:-10px; }
li { letter-spacing:normal; }
就是在ul將letter-spacing調至看不到空白的狀況(請自己多試幾次,找到適合的值)
再設定li回正常的letter-spacing:normal;
本篇參考用display:inline-block做產品列表
一般來說這種列表通常是用float:left達成,不過有些時候用第一個方法會比較靈活
但是要怎麼解決中間有空白呢?
請參考下面:
ul { letter-spacing:-10px; }
li { letter-spacing:normal; }
就是在ul將letter-spacing調至看不到空白的狀況(請自己多試幾次,找到適合的值)
再設定li回正常的letter-spacing:normal;
本篇參考用display:inline-block做產品列表
星期六, 7月 23, 2011
星期一, 6月 13, 2011
HTML5新增的陣列方法
var arr = [1, 2, 3, 4, 5];
arr.every(callback[, thisArg])
對arr內的每個值執行callback,若其中有一個結果回傳false,則函數執行結果為false
thisArg : 做為callback物件的參考
callback: function (value, index, array){ ... }
arr.some(callback[, thisArg])
對arr內的每個值執行callback,若其中有一個結果回傳true,則函數執行結果為true
thisArg : 做為callback物件的參考
callback: function (value, index, array){ ... }
arr.forEach(callback[, thisArg])
對arr內的每個值執行callback
thisArg : 做為callback物件的參考
callback: function (value, index, array){ ... }
Array.isArray(arr)
判斷arr是否為陣列
arr.indexOf(obj[, index])
從arr的索引為index(default=0)的地方開始向右搜索obj,找到傳回obj在陣列的索引,反之則傳回-1
arr.lastIndexOf(obj[, index])
從arr的索引為index(default=陣列長度-1)的地方開始向左搜索obj,找到傳回obj在陣列的索引,反之則傳回-1
arr.map(callback[, thisArg])
函數的回傳值是將arr內的每個值執行callback後,所得的回傳值陣列
callback: function (value, index, array){ ... }
arr.filter(callback[, thisArg])
函數的回傳值是將arr內的每個值執行callback,保留callback回傳true的該值所得的陣列
callback: function (value, index, array){ ... }
arr.reduce(callback[, initValue])
函數將由左至右依序將arr內的值傳入callback,preValue是上一個callback的回傳值,curValue則是目前的值。
函數的執行結果是arr最左邊的值呼叫callback的回傳值
initValue: 若是最右邊的值呼叫callback的時候,preValue=initValue
callback : function (preValue, curValue, currentIndex, array){ ... }
arr.reduceRight(callback[, initValue])
函數將由右至左依序將arr內的值傳入callback,preValue是上一個callback的回傳值,curValue則是目前的值。
函數的執行結果是arr最右邊的值呼叫callback的回傳值
initValue: 若是最左邊的值呼叫callback的時候,preValue=initValue
callback : function (preValue, curValue, currentIndex, array){ ... }
arr.every(callback[, thisArg])
對arr內的每個值執行callback,若其中有一個結果回傳false,則函數執行結果為false
thisArg : 做為callback物件的參考
callback: function (value, index, array){ ... }
arr.some(callback[, thisArg])
對arr內的每個值執行callback,若其中有一個結果回傳true,則函數執行結果為true
thisArg : 做為callback物件的參考
callback: function (value, index, array){ ... }
arr.forEach(callback[, thisArg])
對arr內的每個值執行callback
thisArg : 做為callback物件的參考
callback: function (value, index, array){ ... }
Array.isArray(arr)
判斷arr是否為陣列
arr.indexOf(obj[, index])
從arr的索引為index(default=0)的地方開始向右搜索obj,找到傳回obj在陣列的索引,反之則傳回-1
arr.lastIndexOf(obj[, index])
從arr的索引為index(default=陣列長度-1)的地方開始向左搜索obj,找到傳回obj在陣列的索引,反之則傳回-1
arr.map(callback[, thisArg])
函數的回傳值是將arr內的每個值執行callback後,所得的回傳值陣列
callback: function (value, index, array){ ... }
arr.filter(callback[, thisArg])
函數的回傳值是將arr內的每個值執行callback,保留callback回傳true的該值所得的陣列
callback: function (value, index, array){ ... }
arr.reduce(callback[, initValue])
函數將由左至右依序將arr內的值傳入callback,preValue是上一個callback的回傳值,curValue則是目前的值。
函數的執行結果是arr最左邊的值呼叫callback的回傳值
initValue: 若是最右邊的值呼叫callback的時候,preValue=initValue
callback : function (preValue, curValue, currentIndex, array){ ... }
arr.reduceRight(callback[, initValue])
函數將由右至左依序將arr內的值傳入callback,preValue是上一個callback的回傳值,curValue則是目前的值。
函數的執行結果是arr最右邊的值呼叫callback的回傳值
initValue: 若是最左邊的值呼叫callback的時候,preValue=initValue
callback : function (preValue, curValue, currentIndex, array){ ... }
訂閱:
文章 (Atom)