Javascript: Check an element’s value change not made by user 18 July 2014 Jeff JavaScript Problem: We all know if an input’s value was changed by user input, we can capture this change event by $('input').change(function(event){ console.log('user changed the value.'); }); But if t... [More]
[Solved] Uncaught Error: Can’t find closing comment tag to match: ko if: ***. 17 April 2014 Jeff JavaScript Background: I spent a lot of time to debug this knockout js error as the title shows, and finally I found the cause which made me kind of angry because it was not worth wasting so much time on it. L... [More]
Bundle javascripts safely in ASP.NET MVC 01 April 2014 Jeff ASP.NET, MVC, C# Problem: The other day I spent a lot of time to figure out that why my web application didn’t work correctly is because of the ASP.NET MVC default JavaScript bundle renamed the function name of Canva... [More]
Replace Telerik window with jquery-ui dialog 28 February 2014 Jeff ASP.NET, C#, JavaScript When you need to display some information via pop up window, it's better to use jquery-ui dialog than Telerik window. Not only because the Telerik is not supported any more, but also because the jquer... [More]
将小数转化为分数的算法 21 January 2014 Jeff Math 数学, Programming 编程, JavaScript 问题: 对于一个分数,使用除法就能够得到其小��表示。如: 2/3 = 0.666666… 一般计算器都支持将分数转化成小数的计算模式。但是反过来,拿到一个小数,怎么得到其分数的表示形式呢?似乎没有像除法这样直接的算法,而且一般的计算器和计算程序都没有将分数转化成小数的模式。 比如,拿到一个小数:0.571428571428…,怎么知道它等于4/7? 分析: 小数可分为以下几种: ... [More]
Javascript implementation of String.format() 31 July 2013 Jeff JavaScript Background: The String class has a format() method in C# which is very handy to build dynamic messages from a template. For example, Console.WriteLine(String.Format("Current Page Index: {0}, ... [More]
A navigation control plugin for Flot 23 July 2013 Jeff JavaScript Background: Flot is an open source javascript library for drawing attractive charts, and there is a plugin named jquery.flot.navigation.js to allow user to pan or zoom the charts. However, it is hard... [More]
A Flot plugin for saving canvas image to local disk 02 July 2013 Jeff JavaScript Background: Flot is an open source javascript library to draw attractive charts. I’ve made a plug in for it to allow user save the beautiful chart as an image to local disk as png/bmp/jpeg files by m... [More]
连锁反应 Chain Reactive 21 June 2012 Jeff WebDigest 网海拾贝, JavaScript 一款好玩的游戏: A funny game implemented via HTML 5 and javascript: HTML5和JavaScript做出来的好玩游戏!
在JavaScript中实现重载机制 21 June 2012 Jeff JavaScript 一、背景: 在面向对象的编程语言中,通过重载机制,使得同一个方法名可以具有不同的实现,这些不同的实现版本具有不同的参数(个数、类型都可以不同)。这些不同的参数形成了方法的不同的特征(或者叫签名),从而在使用中,即使方法名相同,程序也能正确地找到对应的版本。 在JavaScript中,没有内置的重载机制,但是它对每个方法(函数)都提供了一个arguments对象,该对象具有传递过来的参数信息,我... [More]