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:
Archive for the 'javascript' Category
Reset the scroll position on the page
15:27 |
javascript |
730 views
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…
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…
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:
Goal: create class allow creation without the new keyword The pattern is simple: The creation itself is the following:
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.
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.
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:
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:
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.
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.
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
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
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!
Goal: jump to the next inputbox there is a simple jumper function: jQuery is in the background!
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
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
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.
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.