Learn how to detect an “undefined” object property in JavaScript
Use following code to detec an undefined object property in javascript. if (typeof YOUR_VARIABLE === “undefined”) alert(“YOUR_VARIABLE is undefined”);
Continue Reading →By admin|JavaScript
Use following code to detec an undefined object property in javascript. if (typeof YOUR_VARIABLE === “undefined”) alert(“YOUR_VARIABLE is undefined”);
Continue Reading →Here are the css rule to disable text selection highlighting. -webkit-touch-callout: none; -webkit-user-select: none; -khtml-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none;
Continue Reading →By admin|JavaScript
The result of 1/0 is Infinity. parseInt treats its first argument as a string which means first of all Infinity.toString() is called, producing the string “Infinity”. So it works the same as if you asked it to convert “Infinity” in base 19 to decimal. Here are the digits in base 19 along with their decimal […]
Continue Reading →In this video you will learn how to control the speed of your vehicle while doing a reverse manoeuvre. The control of your speed is a critical part of achieving a good result. You will see how to observe all around you and know where to look and at what point to turn your vehicle.
Continue Reading →After upgrading to OS X Lion and after that cannot initialize Git where it used to work: $ git add -bash: git: command not found The solution is bit easy. The default install location is /usr/local so add this to your ~/.bash_profile export PATH=$PATH:/usr/local/git/bin/ then run source ~/.bash_profile in Terminal
Continue Reading →If you want to make a site where users can submit files, and then randomly view one by one on another page then, you can use the following function. Here, I have a directory called “uploads” where the files are submitted. Here, you can use glob or opendir() to get all files in a directory, […]
Continue Reading →Start with a basic square and borders. Each border will be given a different color so we can tell them apart: .triangle { border-color: yellow blue red green; border-style: solid; border-width: 200px 200px 200px 200px; height: 0px; width: 0px; } which gives you this: More shapes But there’s no need for the top border, so […]
Continue Reading →First of all, you can control cellspacing by applying the border-spacing CSS property to your table. If you need to support IE 5, 6, or 7, you’re almost out of luck. This will work in almost all popular browsers except for IE up through v7. For browsers which support it, this property will even allow […]
Continue Reading →By admin|JavaScript
Here is the way to get timestamps in JavaScript and this will return the number of milliseconds since the epoch. new Date().getTime();
Continue Reading →There are two ways to “undo” last commit, depending on whether or not you have already made your commit public (pushed to your remote repository): How to undo a local commit Lets say committed locally, but now want to remove that commit. git log commit 101: bad commit # latest commit, this would be called […]
Continue Reading →