Место где живут одни ГАИ и друг друга штрафуют
If you need for frontend just copy modified resources
mvn -Dmaven.test.skip=true war:exploded
they will be copy to target folder.
To enable ExtJS CORS, just add:
Ext.Ajax.useDefaultXhrHeader = false; Ext.Ajax.cors = true;
Working fine for ExtJS 4.
Idea about how bundle all resource into one file Web Resource Bundle
Often to create a new array in JavaScript we use slice method. But there’re exist 3 ways to do it:
Array.prototype.slice.call
Array.slice
[].slice.call
So what the difference?
First one, is the common one. It used to create an array from non-array type objects, like arguments for instance.
(function fn() {
var args = Array.prototype.slice.call(arguments);
console.log(arguments instanceof Array); // false
console.log(args instanceof Array); // true
})();
What have happened? And why use prototype?
We use prototype, as slice method is method of Array object but not of class (not static).
To archive that method we use prototype (thanks God they used prototype for adding methods
)
Why we use call? Because slice method used this, and it’s important who called it!
Next example works only in Mozilla:
(function fn() {
var args = Array.slice(arguments);
console.log(arguments instanceof Array); // false
console.log(args instanceof Array); // true
})();
And the last example works in any browser (I’m not sure about IE, but anyway it isn’t a browser
):
(function fn() {
var args = [].slice.call(arguments);
console.log(arguments instanceof Array); // false
console.log(args instanceof Array); // true
})();
First of all, [] – it’s an array instance, thats why we can use slice method.
And of course we must use call method to archive appropriate this pointer value.
BTW, use can also use Array() to create an instance. In this case example will be:
(function fn() {
var args = Array().slice.call(arguments);
console.log(arguments instanceof Array); // false
console.log(args instanceof Array); // true
})();
nothing special, but you have to know it.
javascript:R=0; x1=.1; y1=.05; x2=.25; y2=.24; x3=1.6; y3=.24; x4=300; y4=200; x5=300; y5=200; DI=document.getElementsByTagName("img"); DIL=DI.length; function A(){for(i=0; i-DIL; i++){DIS=DI[ i ].style; DIS.position='absolute'; DIS.left=(Math.sin(R*x1+i*x2+x3)*x4+x5)+"px"; DIS.top=(Math.cos(R*y1+i*y2+y3)*y4+y5)+"px"}R++}setInterval('A()',50); void(0);


