PIXNET Logo登入

Kenneth的部落格

跳到主文

部落格全站分類:

  • 相簿
  • 部落格
  • 留言
  • 名片
  • 3月 30 週三 201600:57
  • JavaScript 複習筆記 -新觀念

1. Minimise Access to Page Elements
 
(繼續閱讀...)
文章標籤

Kenneth 發表在 痞客邦 留言(0) 人氣(27)

  • 個人分類:Javascript
▲top
  • 6月 26 週五 201504:30
  • Javascript 運算子 === (identity operator) vs == (equality operator)


識別運算子:===、!==
英文 : These operators behave the same as the equality operators, except that no type conversion is done.
中文 : 這些運算子的行為方式和等號比較運算子相同,但是有一點例外,就是不會進行型別轉換。 如果兩個運算式的型別不同,這些運算式一定會傳回 false。
(繼續閱讀...)
文章標籤

Kenneth 發表在 痞客邦 留言(0) 人氣(306)

  • 個人分類:Javascript
▲top
  • 4月 27 週一 201501:49
  • JScript – Convert Image To Base64

Yesterday I was updating an HTA (HTML Application) and needed to figure out how to convert an image into a base64 code that could be used in a stylesheet. I needed this to be able to embed an image in the source code instead of referencing an actual image. For this reason I wrote the following function (with the help of this post):
 

function convertImageToBase64(filePath) {
  var inputStream = new ActiveXObject('ADODB.Stream');
  inputStream.Open();
  inputStream.Type = 1;  // adTypeBinary
  inputStream.LoadFromFile(filePath);
  var bytes = inputStream.Read();
  var dom = new ActiveXObject('Microsoft.XMLDOM');
  var elem = dom.createElement('tmp');
  elem.dataType = 'bin.base64';
  elem.nodeTypedValue = bytes;
  var ret = 'data:image/png;base64,' + elem.text.replace(/[^A-Z\d+=\/]/gi, '');
}
 
But it cannot work in IE9. I get an error saying Access is denied, IE doesn't allow manipulation of the type="file" input element from javascript due to security reasons. Setting the filename or invoking a click event to show the browser dialog will result in an "Access is denied" error on the form submit - Internet Explorer is clever about remembering what methods have been invoked.
 
(繼續閱讀...)
文章標籤

Kenneth 發表在 痞客邦 留言(0) 人氣(45)

  • 個人分類:Javascript
▲top
1

個人資訊

Kenneth
暱稱:
Kenneth
分類:
好友:
累積中
地區:

熱門文章

  • (808)新手學習Mantis筆記 --移除作業平台 How to remove the profile fields
  • (4,063)SCHOTT ZWIESEL 德國蔡司
  • (1,399)[品酒] 甜酒之王- Pourriture Noble 貴腐甜酒
  • (14,118)馬來西亞之旅 --蘭卡威 Langkawi 旅行規劃
  • (21,507)馬來西亞之旅 --檳城 Penang 旅行規劃
  • (1,135)馬來西亞之旅 --馬六甲 Malacca 旅行規劃
  • (215)馬來西亞之旅 2014-11 第二站第一天 檳城 Penang
  • (306)馬來西亞之旅 2014-11 第二站第二天 檳城 Penang
  • (158)馬來西亞之旅 2014-11 第三站 馬六甲 Malacca
  • (222)Kentico學習筆記-開發

文章分類

  • Google Analytics (2)
  • 新加坡 (3)
  • 藝術 (2)
  • 軟體開發筆記 (27)
  • Javascript (3)
  • Kentico 學習筆記 (2)
  • 馬來西亞遊記 (10)
  • Travel (21)
  • 學習筆記 (23)
  • Microsoft 微軟 (3)
  • 閱讀筆記 (39)
  • English (1)
  • Movie (6)
  • Tips (7)
  • installshied (1)
  • VBA (2)
  • Wine World (24)
  • News (2)
  • Seminar (1)
  • SharePoint2010 (3)
  • windows Server 2008 (3)
  • 未分類文章 (1)

最新文章

  • 2019 第一本書 “我住在焦慮星球”
  • 2018年旅行 土耳其 卡帕多奇亞 Cappadocia 搭 飛機到--> Lzmir 阿德南·曼德列斯機場搭火車去 --> Seluck
  • 2018年旅行 土耳其 6/11-6/13 卡帕多奇亞 Cappadocia 驚喜連連
  • 2018年旅行 土耳其 6/10 ->6/11 搭夜間巴士到 Safranbolu 番紅花城-->安卡拉搭巴士去 -->卡帕多奇亞 Cappadocia
  • 2018年旅行 土耳其 6/10 ->6/11 搭夜間巴士到 Safranbolu 番紅花城-->安卡拉搭巴士去 -->卡帕多奇亞 Cappadocia
  • 6/8 ->6/9 ->6/10 新加坡 --> 薩比哈·格克琴國際機場 --> Kadikoy 碼頭搭船 -->伊斯坦堡 -->Safranbolu
  • 2018年旅行 6/8~6/18土耳其
  • 2018 第三本書 在飛機上遇見彼得.杜拉克:真希望開店前就知道的事
  • 2018 第二本書 “你說-寮國到底有什麼”村上春樹
  • 2018 第一本書 鹽鐵論:漢代財經大辯論

動態訂閱

文章精選

文章搜尋

參觀人氣

  • 本日人氣:
  • 累積人氣:

誰來我家