Goal: give some additional function to the Array type // 1. remove the specified element TypeExtend(Array, ‘remove’, function(from, to) { try{ var rest = this.slice((to || from) + 1 || this.length); this.length = from < 0 ? this.length + from : from; return this.push.apply(this, rest); } catch(e){ return false; } }); // 2. remove all […]
Archive for the javascript
Category
extender – Array
16:52 |
javascript
|
1047 views
extender – Object
22:52 |
javascript
|
1240 views
Goal: give some additional function to the Object type available extends: objectId: global unique identifier for every DOM and non DOM object _bind, _unbind, _trigger: bind logic for every DOM and non DOM object _trace, _watch: easy setable trace and watch functionality _catch (SET catching): bind a function to the variable setter _chain: to investigate […]
Goal: give some additional function to the Object type available extends: objectId: global unique identifier for every DOM and non DOM object _bind, _unbind, _trigger: bind logic for every DOM and non DOM object _trace, _watch: easy setable trace and watch functionality _catch (SET catching): bind a function to the variable setter _chain: to investigate […]
extender – Math
15:05 |
javascript
|
1128 views
Goal: give some additional function to the Math object
Goal: give some additional function to the Math object
random value beetween 2 numbers
14:48 |
javascript
|
1059 views
Goal: get a number between a range let’s extend the Math object:
Goal: get a number between a range let’s extend the Math object:
extender – string
12:47 |
javascript
|
1074 views
Goal: give some additional function to the String type
Goal: give some additional function to the String type
jQuery Easing Cheat Sheet
8:36 |
cheetsheet
, javascript
, jquery
|
1861 views
Goal: provide quick reference of easing 1. coding skeleton 2. easing reference source: easings.net see also: easing fix for wordpress, other cheet sheets
Goal: provide quick reference of easing 1. coding skeleton 2. easing reference source: easings.net see also: easing fix for wordpress, other cheet sheets
javascript extender (TypeExtend)
12:28 |
javascript
|
1113 views
I have read on many pages that this is evil like eval. Everything is evil if you can’t use that. Unsafe extend. In this sample I aggree with the evli idea. This is simple and dangerous. Safe version. Better but not the best. the skeleton and the code instead of this almost nice solution do […]
I have read on many pages that this is evil like eval. Everything is evil if you can’t use that. Unsafe extend. In this sample I aggree with the evli idea. This is simple and dangerous. Safe version. Better but not the best. the skeleton and the code instead of this almost nice solution do […]
string contains other or not
22:39 |
javascript
|
1035 views
in c# we can use to check a string So I need a similar function in javascript. Here is:
in c# we can use to check a string So I need a similar function in javascript. Here is:
replace all linkable url in a string to real link
22:38 |
javascript
|
1044 views
As earlier to solve this is easy to extend the string object.
As earlier to solve this is easy to extend the string object.
cut the unwanted tail
22:37 |
javascript
|
1043 views
There is a big array and the items joined by comma like this: I don’t need the end with the many unwanted comma. I try to cut the string at the last real value. Let’s extend the string object with the followings: to call this:
There is a big array and the items joined by comma like this: I don’t need the end with the many unwanted comma. I try to cut the string at the last real value. Let’s extend the string object with the followings: to call this:

