You are on page 1of 21

17.09.

2015
Unit- ,
, .
1.
.
:
, Unit-;
;
;
-.
:
;
.
2.
.
3. .
4. .
:
1.
, .
:
.
:
.
.
.
2.
,
.
:
.
.
:

.
.
.
.
.

2 .
Unit- :
1.
2.
3.
4.

Selenium (Wed app).


Test Complete (desktop + Web app).
. ( ).
Jmeter ( ).
,
, .

:
1. : production.
2. : production .
3. .
.
:

dev

.
test

production.

TeamCity.

Git

product

(
)

product

product

Stable

Pretable
Dinamic

stable

21.09.2015
testing

testing

Production

stable

TTP-. .
/1.1. :
.
:
1. .
2. .
3. .

1.
2.
3.
4.

:
.
.
.
.

: WebDev, SOAP,
RSQ.
URI .
URI:
: [//: @] [: ]] [/] [? ][#]
2 : 80, 8080.
abc: //ivan:krasava@lol.com:1021/file/fff.php? Venik1=20 & color=Green #middle.
URI: 2-12 (IE).
URI: , , : $ - _ * () ,
: % ; & ? : @ = \ /.
. 2
: UTF8, CP1251. 16-
%.
%D0%9C%D0%BS%D1%80
%EC%E8%E0
, /IP:
1.
2.
3.
4.
5.

GET http://1.php?val=1.
POST.
Options.
Had.
Put.

6. Patch.
7. Trace.
8. Link.
9. Unlink.
10.Connect.
POST.
2 : .
://Webserver/Localhost/www/my/1.php.
FayerBug, Fiddler.
:
1. .
.
2. .
3.
.
3 :
1. ( ). : HTTP/1.1 200 OK
2. .
3. . , ( ). :
Server: Win.
(-
): X-Frame-Options, X-Requested-With XML
HTTPRequested , XKonkyrent: Preved, X-ServerNichName: Cooter.
: Cache-Control, nocache, no-store, max-Age=0, must-revalidate.
Encoding .
no-cache
(no-store..).
.
-, -.
CGI Common Gateway Interface ( )
-.
.

++ getenv
(__) . CGI
Apache : Options ExecCGI, AddHander
.exe.
:
1.
(REQUEST_METHOD).
2. ,
REQUEST_METHOD GET,
QUERY_STRING. ( POST),
QUERY_STRING,
CONTENT_LENGTH. CONTENT_LENGTH > 0,
CONTENT_LENGTH stdin
CONTENT_LENGTH. .
:
.cpp .

#include <iostream>
#include <cstdlib>
#include <string>
using namespace std;
int main ()
{
char st [1000];
if (getenv (QUERY_STRING))
{
Cout <<
strcpy (st, getenv (QUERY_STRING));
cout << <html> <body> << st << </body> </html>;
}
return 1;
}

GI-glob.
, : localhost /cgiglob/1.exe? param=2bp=3.

08.10.2015
.
.
1.
2.
3.
4.
5.

IE.
Firefox.
Safari.
Chrome.
Opera.

:
1.
2.
3.
4.
5.

URI.
(, ).
.
.
.


, 5 -
.
:
1. (UI).
2. (
).
3.
( ).
4. (
), .
5. UI
, .. ( ).
6. JS
.

7.
( ), 5 -
.
Parsing HTML
DOM TREE

Render tree,

render tree

.
Webkit, Firefox Gecko.
:

.
, .
:
1.

.
2.

. .
3.
.
, .
4.
2- :
( ) ( ).
. .
DTD (Document Type Definition).
:
1.
, .
2.
.
3.
.
4.
.
:
1.
.
2.
.
:
1.
,
.
2.
.
3.
.

:
1.
2.
3.
4.
5.

.
.
.
important.
.

.
*-

00000

Div, first-line

00001

.some-class, [rel]

00010

#SomeID

00100

Style =

01000

Div +!important

10001

Style = +important 1 1 0 0 0

(reflow):
1. ,
, .
2. ( )
, ,
, : .

.
1. ,
.
2. - , ,
, .
3. : ,
( ), , inline-block.

15.10.2015
:
1.
2.
3.
4.
5.
6.
7.
8.
9.

QuerySelector (.b-link)
$ (.b-image).width ()
$ (.b-menu).ofset()
.
Document.forms [0].elements[0].value.
, .
Array.length.
Object.prototye.hasOunProperty.
.

jQuery:
1. sizzle-.
2. .data().
3. Dom-
.
localStorage/session-Storage. .
clear ().
Len qth () .
Key .
removeItem -.
, . 4, 4, 10.6, 10 .
api 20+.
.
.
:
1. array- .
2. .
3. ,
.
4. ,
, .
5. ( ) .
6. .

7. , .
8. L,
, .
9. REDbot.

JavaScript.
:
.
:
1.
2.
3.
4.
5.

: typeof!++.
C ==, ===, instancof.
.
.
.
:
,
. .

:
1. if () {}, try {}, catch () {}, function a () {}.
2. return, throw, break, var, case
:
1. .
2. .
3. .
4. .

.
1. .
2. , .
:
1. ToNumber.
2. ToString.
3. ToBoolean.
4. ToObject.

2+{}; // 2[object 1, object2]


==, ===:
==0;// F
0==; // T
0 == 0; // T
False==undefined; // F
False == null ; // F
Null==undefined; // T

=== 0; // F
0 === ; // F
0 === 0; // F
False === undefined; // F
False === null; // F
Null === undefined; // T

:
[1]>0; // T
[1, 1] > 0; // F
[1,] > 0; // T
[1, ,] > 0; // F

. .
: named Function Expressoin, ItFt. Function
[[Call]].
:
1.
, , ,
.
A ();

Function a () {
B ();
Function b () {
}
}
A();
.
If (true)
{Function (a) {return 1, }}
Else { function a () {return 2, }}
A(); // Firefox return 1, Opera return 2.
CFD+Strict Mode
use strict;
Function expiration ,
.
(function timer () {
setTimeout (timer, 1000);
console.log (+new Date);
} ());
Typeof timer;
2 : 1 ,2 . 1- , 2
(, , , , ).
.
1. .
2.
.
Var a=1;
Function foo () {
Var c=0;
Function bar (e) {
}
Return a+c+e;
Return bar (3);

}
Foo (); // 6

1. .

=1

foo

foo

c=2

bar

bar

2.
This - JS,
. .
[]. this call, apply, bind. This
.
3.
():
Function a ()
{
Console.log (this);
}
A();// window
undefined.
4.

.:

Var foo=
{
Bar: function ()

{
Console.log(this); }};
Foo.bar(); // foo
Var baz ={}
Baz.bar=foo.bar;
Baz.bar ();
Var fooBar=foo.bar
fooBar(); // ?

5.

new.

Var F=function () {
Console.log (this);
Console.log (this.__proto__===A.prototype);
};
New A; // object, true
, new
prototype .
6.

call apply.

this.
Var a=function (a, b) {
Console.log (this, a, b);
};
a.call ([]); // []
a.call ([], 1, 2); // [], 1, 2
a.call ([], [1, 2]); // [], [1, 2]
a.apply ([]); // []
a.apply ([], 1, 2); // [], 1, 2
a.apply ([], [1, 2]); // [], [1, 2].
7. Bind this .

Var a=function () {
Console.log (this, a, b);
};
Var b=a.bind ({});
B(); // {}

.
1.
2.
3.
4.

.
.
.
.

arguments:
1.
.
2.
arguments[0], arguments [1].
3.
arguments.caller,
arguments.collier.
.
2 prototype __proto__,
instanceof.
Prototype .
__proto__ - .
new.

.
Var Foo=function ()
{
// .
This.b=146;
};
Foo.prototype.bar=function ()
{

Console.log (this);
};
Foo.prototype.a=123;
Var foo =new Foo ();
Foo.bar (); // foo
foo.a; //123
foo [b]; // 146
foo.c; //undefined

foo.prototype.c=8;
foo.c; //8

instanceof
__ proto __.
Var Foo=function ()
{
This.b=146;
};
Var foo=new Foo ()
Foo instanceof Foo; // true
Foo instanceof Object; // true
Foo instanceof array; // false

AJAX.
- . Mysite.com Mysite2.com.
1.
2.
3.
4.

Frame iFrame, 1996 .


ActiveX MS XML, 1998.
Ajax, Webz, 2005 .
W3C XML HTTP Request, 2006 ().

JSonp (JSON with padding).


, IE. ,
().
:
1. .
2. .
:
1. , -.
2. .
3. .
Window.jsonFlickerFeed=unction (data)
{
Console.log (data;};
Var service= (http://api.flicker.com/)
(/photos _public.gne?format=json&amp;)
(jsoncallback=jsonFlicker; Feed)
//
Var scriptElement=document.createElement (script);
ScriptElement.src=serviceurl;
Document.body.appendChild(scriptElement);

Post2HiddenIframe
(-), .

:
1. .
2. .
3. .
:
1. .
2. -.

.
<form target =frame action =http://google.com/ method=post>
<input name=data/>
<input type=supmit/>
</form>
<iframe name=frame> </iframe>

XHR2 (CORS)
XMLRequest2 Web Audio API, File System API, WebGL.
, : , longPolling.
:
1.
2.
3.
4.

X-domen Request.
.
.
6 .

PHP. .
.
- <?.
.
<?
$my=20;
echo $my;
$my=cat;
?>

++.
$a=3;
If (++$a==10)
Echo $a;
.

==
===
!==
!=
And .
&& - .
Or - .
Xor . true,
false,
.

: ,
,
. !
$ingredient=$amiak xor $hlorka;
,
, ,
. -
. :

Mysql_select_db ($database) or die ( );

php 2 :
1.
.
2. .
. .
. : .

1. - \t.
2. - \n.
3. - \r.
.
.

.
.
heredoc.
. : .

.
Array masiv.
$ar=array(Lemon, Orange, Pineapple);
For ($i=0; $i<$ar.size($ar); $i++)
Echo $ar[$i] </br>;
09.11.2015
().

. , $_POST $_GET,
MySQL(SQL-).
.
htmlentities.
.
: $came_from=htmlentities($_SERVER[]);

1.
2.
3.
4.
5.

.
~ ( ).
<<, >>.
& ( ).
|.
^.
.

. $c=(int)($a/$b);
float, double, real,
string, array, object.
:
.

&.
$a=7.8;
$b=&$a; // 7.8
$b=ne;
Echo b=$b, a=$a;


.

.


.
$a=7.8;
$b=Liga;
$c=40;
$d=

.
:
1. .
2. : , new,
.
Include, reque.
Include
. , Include
. _, ,
, , Include_
.