Tag Archives: JavaScript

Trigger window.resize event via javascript

2016-06-15 Use below code to trigger window.resize event. This can be helpful to refresh some libraries like Chartist.js when a panel  or a div the control is contained in is expanded. P.S. The above method isn’t supported by Internet explorer (failed on … Continue reading

Posted in Javascript | Tagged , , , | Leave a comment

JavaScript Null Coalesce

2016-06-07 Use || similar to ?? in C# example (mvc)

Posted in Javascript | Tagged , | Leave a comment

Browser and length independent CSV download code

17-09-2015 Downloading a csv string as a file on browser can be troublesome. Some techniques don’t work for very long CSV strings and some techniques only work on some browsers. Below code is tested on Internet Explorer 11, Firefox 27.0.1, … Continue reading

Posted in Web Development | Tagged , | Leave a comment

Javascript define objects with sub objects in single line

var tmp = {sub:{title:’titlex’, alt:’altx’}, viewName:’xxx’};   “sub” is the sub object that has properties, title and alt. ViewName is a property of the parent class.

Posted in Web Development | Tagged , , | Leave a comment

A Simple JavaScript To Get English Language Definition From A Dictionary

2009-05-19 English is not my first language so I use online dictionaries frequently as a part of my daily routine to clarify and learn unfamiliar words as I read through articles in the Internet. I have been using www.ditionary.com for … Continue reading

Posted in General Computing, Internet | Tagged , , , , , , | Leave a comment