Archive for the 'javascript' Category

23 Oct 2015

Reset the scroll position on the page

15:27 | javascript | 730 views

Goal: reset the scroll position If the page content is dinamically loaded sometimes we need to reset the scroll position of the page. Like this:


15 Sep 2015

store object in the SessionStorage

10:27 | javascript | 762 views

Goal: to store object on the client side The following code is simple not working: the result is: We need to stringify the object before the store like this: now the result is: and we are happy…


26 Jul 2015

Class with optional new keyword

20:49 | javascript | 778 views

Goal: create class allow creation without the new keyword The pattern is simple: The creation itself is the following:


24 May 2015

list of chrome resources

17:42 | javascript | 1026 views

Goal: there was no reason There is a simple mode to list some resources from the Chrome. I have digged the following resource ids from the chrome.dll file. This code running on an empty page! Paste the following code to the developer consol and see the result.


23 May 2015

get chrome version number

9:44 | javascript | 800 views

Goal: simple and quick way to find the version of the browser Be careful this is only for Chrome and based on the user agent string. the user agent string is: and the extracted result is:


7 May 2015

extender – HTMLInputElement

0:14 | javascript | 800 views

Goal: give some additional function to the HTMLInputElement type the usage is very simple: in this case the inputbox value is and all the text selected this extender working in ie as well.


7 May 2015

How to crash the Chrome from javascript

0:01 | javascript, web trick | 930 views

Goal: there is no goal at all… I have came across an unhandled exception in the Chrome what is crashing the actual page. The js command is simple: so and there is a living issue ticket (somebody else found this as well): jump


4 May 2015

select the next inputbox

11:10 | javascript | 777 views

Goal: jump to the next inputbox there is a simple jumper function: jQuery is in the background!


2 May 2015

element creation with templates

17:49 | javascript | 881 views

Goal: to create a quick template based element creation method Everyday task to manage item templates. We have a container and the template of the items. the result will be: to achieve this we have to extend the String object with a template function: the TypeExtend function itself is here: jump


24 Mar 2015

get all the parents

2:43 | javascript | 907 views

Goal: create a simple way to collect all the parents The code is the simpliest on the world: …the result is an array with the parents of the element. The same idea but width size: …the result is an array with the width of all the parents of the element.


#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; }