之前分享使用FireFox書籤來即時翻譯網頁。
而單字翻譯,Google toolbar仍有其不足,故寫了個小小Bookmarklet,線上英漢字典,將網頁文字圈選,即可利用http://cdict.net/來查詢此單字。
請將下列Bookmarklet置換那http://cdict.net/的Bookmark。
javascript:(function(){d=document;w=window;S=w.getSelection();U="http://cdict.net/"+S;if(S!=""){w.open(U,"%E7%B7%9A%E4%B8%8A%E8%8B%B1%E6%96%87%E5%AD%97%E5%85%B8","width=600,height=500,location,status,scrollbars,resizable,dependent=yes");}else{w.alert("%E8%AB%8B%E9%81%B8%E6%93%87%E6%96%87%E5%AD%97%EF%BC%81%EF%BC%81");}})()


可不可以寫一個bookmarklet是抓n詞酷的例句?也是一個線上字典,在http://www.nciku.com.tw,拜託~
很簡單,只要改寫前面網址由http://cdict.net/ -> http://www.nciku.com.tw/search/all/,就可以了。
javascript:(function(){d=document;w=window;S=w.getSelection();U="http://www.nciku.com.tw/search/all/"+S;if(S!=""){w.open(U,"%E7%B7%9A%E4%B8%8A%E8%8B%B1%E6%96%87%E5%AD%97%E5%85%B8","width=600,height=500,location,status,scrollbars,resizable,dependent=yes");}else{w.alert("%E8%AB%8B%E9%81%B8%E6%93%87%E6%96%87%E5%AD%97%EF%BC%81%EF%BC%81");}})()
Google字典
javascript:(function(){d=document;w=window;S=w.getSelection();U=%22http://www.google.com.tw/dictionary?langpair=en|zh-TW&q=%22+S;if(S!=%22%22){w.open(U,%22%E7%B7%9A%E4%B8%8A%E8%8B%B1%E6%96%87%E5%AD%97%E5%85%B8%22,%22width=600,height=500,location,status,scrollbars,resizable,dependent=yes%22);}else{w.alert(%22%E8%AB%8B%E9%81%B8%E6%93%87%E6%96%87%E5%AD%97%EF%BC%81%EF%BC%81%22);}})()