Archive for the 'javascript' Category

14 Jun 2014

post editor with TAB support and ctrl+s to update post

20:00 | javascript, wordpress | 944 views

Goal: to use the TAB key in the post editor 1. The following code catching the TAB key and replace it with 2 spaces. The second effect is to replace all the TAB occurences (hold the SHIFT key while press a TAB down). 2. You can update your post with alt+p (this is the default), […]


13 Jun 2014

chromium – full screen javascript control lose after F11 pressed

20:28 | javascript | 995 views

During my work I’ve came across a strange issue in chrome (the situation is the same strange in other browsers…). Here is the ticket for the chromium team. The story is: I try to use the full screen from javascript code. It’s working but we need to say this is like marshland in every browser. […]


11 Jun 2014

no more cache – force the reload

21:13 | javascript, web trick | 747 views

Goal: to avoid the cache provided old file versions If I load an external javascript or css file from js code like this: First time is ok, but second time may be I will receive the file from the cache. To avoid the cache just put some fake parameter to the end of the file […]


9 Jun 2014

show the function call chain

14:07 | javascript | 786 views

Goal: catch the call chains in javascript I want to see my program’s footprint. So the hard way is to build a log mechanism… The easier is to use my _trace utility. _chain function. To achieve my goal I need to watch all my functions. This is not a complicated task if I use the […]


6 Jun 2014

javascript if function – created on other way

10:19 | javascript | 685 views

Goal: to go out of box… The if construction is simple Meanwhile I use the following for in many cases: But! Never use return from the comma chain! someThing == ‘value’ && ( $(this).stop().animate({‘opacity’:0}, 250), this.obj.isHidden = true, return true; /*


5 Jun 2014

easy trace in javascript

9:10 | javascript | 720 views

Goal: to notice the console trace function Who called my function? Easy question if you know about how you can trace. Just put one line to your function: This is for functions. If you want to know about variable changes, use getter/setter use this form So this is nice but here is a more flexible […]


5 Jun 2014

split to array is sometimes dangerous

8:58 | javascript | 707 views

Goal: to notice the split function special feature just split a delimited string to an array: but there is a strange behavior we have an empty element! We need to check the source string is valid or not. The result is correct now. Just be careful.


1 Jun 2014

animated funny mushroom on the date brick

21:17 | javascript | 759 views

This is a funny post… 2 June 2014 1 June 2014 this post is about he and his brothers. Yes, he is not alone… Click on the date block on the left side. The mushroom jumping on from the far. Twinkling, bored, jumping, for a while waiting and jumping down to nowhere. Let’s check the […]


1 Jun 2014

bindable none DOM objects

17:52 | javascript | 692 views

Goal: to build an effective handshake mechanism between objects In jQuery we have the very useful bind/trigger logic. I want to use some similar on my objects. What I will do I will extend the Object class with 3 methods, like _bind, _unbind, _trigger _bind: to attach a function to my object _unbind: to detach […]


1 Jun 2014

shrink an array

17:06 | javascript | 679 views

When you drop an element from an array by The second item will be there with value. Let’s delete more than one item from the array and there will be many holes in the line. Here is a simple shrink function to solve this problem. This is a simple Array extension. var shrink = function() […]


#sidebar a { color:#fff; } #sidebar ul ul li { color: #DEF585; } #sidebar h2 { color: #fff; } #sidebar ul p, #sidebar ul select { color: #BEDDBE; } #backfly { background: url(images/golfBallWallPaper.jpg) left bottom fixed repeat-x #65a51d; }