Tag Archives: javascript

regex

Share Just wanted to share regex reference site. You can check it here http://www.grymoire.com/Unix/Regular.html for more details. What is a Regular Expression? A regular expression is a set of characters that specify a pattern. The term “regular” has nothing to … Continue reading

Posted in regex | Tagged , , , | 1 Comment

stopPropagation() and cancelBubble

Share Another way of doing the cancelBubble: function dropButtonClick(e) { if( typeof( e ) == “undefined” && typeof( window.event ) != “undefined” ) e = window.event; // do things…. if (typeof( window.event ) != “undefined” ) { // IE e.cancelBubble=true; … Continue reading

Posted in javascript | Tagged , , | Leave a comment

cancelBubble

ShareI have this function but something was wrong with firefox. I got undefine value. After taking a closer look in my code I forgot to pass the ‘event’ parameter on my function. function dps_cancel_bubble(e) { if (!e) var e = … Continue reading

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

array push in javascript

ShareExample: for(d = 0; d< arr.length; d++){ arr2[arr2.length++] = arr[d]; } source: http://blog.dreamvib.com/programming/javascript-array_push/

Posted in javascript | Tagged , | Leave a comment

javascript: typeof

Share typeof returns one of the following strings: number string boolean object function undefined typeof(typeof(x)) is always string, no matter what x actually is. IE seems to think that some functions are objects rather than functions: typeof(document.getElementById) returns object.   … Continue reading

Posted in javascript | Tagged , | Leave a comment