Rodomi pranešimai su žymėmis 70-480. Rodyti visus pranešimus
Rodomi pranešimai su žymėmis 70-480. Rodyti visus pranešimus

2017 m. gegužės 7 d., sekmadienis

70-480: More HTML5 (skyrius 5)

Vietoje < table > rekomenduojama naudoti < div > ir < span >.

Paveiksliukas is 209 psl

< header > pakeičia ankščiau naudotą < div id = ' header ' >

< wbr  / > -nurodo, kad toje vietoje naršyklė įdės word break line.
< dfn > - definition instance of term.


< figure > - rodo, kad paveikslėlio vieta nesvarbi
< img / >
< figcaption / > - paboldintas tekstas
< / figure >


http://html5doctor.com/the-figure-figcaption-elements/

< details / >
< summary / >

< table > - yra galingas, bet tuo pačiu ir sudėtingas įrankis, todėl juo reikia nepiktnaudžiauti.


2016 m. kovo 15 d., antradienis

70-480: įvairūs

Absolute panaikina float veikimą. Float galima naudoti ne visiems, o tik block-level elementams.

z-index - kaip steke išdėlioja elementus. Su didesne reikšme elementas dedamas aukščiau. Jis veikia tik su pozicionuotais elemetais: position: absolute, position:relavive arba position:fixed.

Position:
- static (default). Elementai išdėstomi ta tvarka, kuria yra dokumente.
- absolute. Elementas pozicionuojamas relative pagal pirmą ne statinį protėvį.
- relative. Elementas pozicionuojamas relative pagal savo relavite poziciją: "left:20". Prideda 20 pikselių į elemento left poziciją.
- fixed. Elementas poziciuojamas relative pagal naršyklės langą
- inherit. Pozicionavimo savybė paveldima iš tėvinio elemento.


parseInt(string, radix) - iš eilutės grąžina skaičių.
radix - parodo, kokią skaičiavimo sistemą naudoti: šešioliktainę (16) ar dešimtainę (10).
Tik pirmas eilutės skaičius yra grąžinamas.

Jeigu radix nėra nurodytas, JavaScrip apdoroja taip:

  • jei eilutė baigiasi 0x, tai bus šešioliktainė sistema;
  • jei eilutė baigiasi 0, tai bus 8-ainė sistema. Nebenaudojama.
  • jei bet kokia kita reikšmė - bus 10-ainė sistema.

http://www.w3schools.com/jsref/jsref_parseint.asp

parseFloat - grąžina float tipo skaičių.

CSS3 stilių svarbumas




70-480: Creating flexible layouts with CSS3 (16 video)

- flexbox - elementas, į kurį sudėta nav, content ir sidebar. Visiems jiems galima nustatyti, kiek procentų kuriam skirti, pvz., 10 proc, 80 proc ir 10 proc.


http://ie.microsoft.com/testdrive/Graphics/hands-on-css3/hands-on_flex.htm (atsidarinėti su IE naršykle)

- grid alignment - vietoje lentelių galime naudoti gridą, kuris taip pat turi eilutes, stulpelius. Taip daug paprasčiau nurodyti stilius.


http://ie.microsoft.com/testdrive/Graphics/hands-on-css3/hands-on_grid.htm - kaip dirbti su ms-grid

-ms-grid-rows: [ auto | height | min-content | max-content | minmax(min, max) ] + | none

auto
The width of a column is computed based on the widest child element in that column. This keyword is equivalent to minmax(min-content, max-content).
width
The width of each column specified as one of the following values:
  • A length consisting of an integer number, followed by an absolute units designator ("cm", "mm", "in", "pt", or "pc") or a relative units designator ("em", "ex", or "px").
  • A percentage of the object width.
  • A proportion of the remaining horizontal space (that is, the object width, less the combined widths of other tracks), consisting of an integer number followed by a fractional designator ("fr"). For example, if "200px 1fr 2fr" is specified, the first column is allocated 200 pixels, and the second and third columns are allocated 1/3 and 2/3 of the remaining width, respectively.
min-content
The minimum width of any child elements is used as the width of the column.
max-content
The maximum width of any child elements is used as the width of the column.
minmax(min, max)
The width of the row is between min and max, as available space allows. The min and max parameters can be any other value of the -ms-grid-columns property, except for auto.
none
Initial value. The object has no specified columns. Implicit, auto-sized columns will still be created based on the grid position(s) of the child element(s).


- multi-column - tekstą galima padalinti į kiek norime stulpelių...

http://ie.microsoft.com/testdrive/Graphics/hands-on-css3/hands-on_multi-column.htm

- exclusions - darbas su SVG elementais


http://ie.microsoft.com/testdrive/Graphics/hands-on-css3/hands-on_positionedfloats.htm - positioned floats

- regions - flox content of lox elements(?)



http://ie.microsoft.com/testdrive/Graphics/hands-on-css3/hands-on_regions.htm
http://www.html5rocks.com/en/tutorials/regions/adobe/ - panaudoti SVG elementai

Rašant CSS vengti dublikavimo, t.y. grupuoti stilius

Daug pavyzdžių: http://ie.microsoft.com/testdrive/Graphics/hands-on-css3/

http://caniuse.com

70-480: RegExp



http://www.w3schools.com/jsref/jsref_obj_regexp.asp

stogelis - žymi įvedimo pradžią
$ - žymi įvedimo pabaigą
+  rodo, kad įrašų, kaip laužtiniuose skliaustuose galime kartoti kiek norime, t.y. vieną ir daugiau
(foo) - tarp skliaustelių esantis tekstas būtinai t.b. nurodytas, pvz., "foo bar"

\d žymi skaičių, ekvivalentas [0-9]
. žymi vieną simbolį, pvz., /.y/ žymi "my", "ay", o ne "yes"
* leidžia bet kokį kiekį ankščiau nurodytų simbolių

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp

70-480: įvairūs, XMLHttpRequest readyState and status

CSS3 nth-child

The :nth-child(n) selector matches every element that is the nth child, regardless of type, of its parent.
n can be a number, a keyword, or a formula. Pavyzdžiui, li:nth-child(3)  pažymės 3 sąrašo elementą.

Taip pat galite naudoti formulę an+b, kai
a- ciklo skaičius
n- ciklo kintamasis
b- nurodo, kurį elementą pažymėsime

Pavyzdžiui, li:nth-child(10n+3) - pažymės 3 elementą iš kiekvienos 10 elementų grupės. Taigi, jei ul turi 45 elementus, tai bus pažymėti 3, 13, 23, 33 ir 43.

Taip pat galime naudoti odd ir even, kad pažymėtume porinius arba neporinius elementus.

Pavyzdžiui, li:nth-child(odd) pažymi 1, 3, 5, 7 ir t.t.

CSS3 nth-of-type

Raudonai pažymės kiekvieną p elementą, kuris yra antras elementas tėviniam elementui

p:nth-of-type(2)
{
background:#ff0000;
}


JQuery.ajax

contentType (default: 'application/x-www-form-urlencoded; charset=UTF-8')
Type: String
When sending data to the server, use this content type. Default is "application/x-www-form-urlencoded; charset=UTF-8", which is fine for most cases. If you explicitly pass in a content-type to $.ajax(), then it is always sent to the server (even if no data is sent). The W3C XMLHttpRequest specification dictates that the charset is always UTF-8; specifying another charset will not force the browser to change the encoding.

type (default: 'GET')
Type: String
The type of request to make ("POST" or "GET"), default is "GET". Note: Other HTTP request methods, such as PUT and DELETE, can also be used here, but they are not supported by all browsers.

onLine

navigator.onLine savybė grąžina boolean reikšmę, kuri rodo, ar browseris prisijungęs prie interneto, ar ne.


Navigator objektas laiko informaciją apie browser.

XMLHttpRequest


readyState gražiną dabartinio dokumento statusą:
0 - užklausa neinicializuota (request not inicialized);
1 - serverio ryšys nustatytas (server connection established)
2 - užklausa gauta (request received)
3 - užklausa vykdoma (processing request)
4 - užklausa baigta ir atsakymas paruoštas (request finished and response is ready)

status:
100 - continue
200 - standartinis atsakymas sėkmingai HTTP užklausai
300 - rasti keli atsakymai pagal pateiktus duomenis
400 - bloga užklausa

70-480: Įvairūs AJAX

AJAX apibrėžime naudojami autentifikacijai:


password
username

APIs:
XMLHttpRequest
Geolocation - naudojamas geografinei userio pozicijai

Geolocation API


getCurrectPosition - paima dabartinę poziciją
watchPosition -grąžina dabartinę poziciją ir rodo video

Geolocation naudojamas iPhone ir GPS.

http://www.w3schools.com/html/html5_geolocation.asp

Klaidų gaudymo blokas:

try
catch(e)
finally

Draggable elements

Jei norime, kad elementai būtų draggable, reikia pridėti atributą draggable = true

DataTransfer.setData() - siunčia duomenų tipą ir reikšmę tempimui (?)

function drag(ev){
 ev.dataTransfer.setData("text", ev.target.id);
};

onDragOver - nurodo, kur tą reikšmę galima dėti. Elementai negali būti dedami ant kitų elementų, tam naudojama:
event.preventDefault();

Kai elementas padedamas, iškviečiamas metodas onDrop.

function drop(ev){
 ev.preventDefault(); - naršyklė atidaroma default gaudymui (?)
 var data = ev.dataTransfer.getData("Text"); - paimami persiųsti duomenys
 ev.target.appendChild(document.getElementById(data));
};

Prototype


Prototype savybė leidžia pridėti metodus ar savybes objektui.

Pridėti savybę:

function employee(name,jobtitle,born)
{
this.name=name;
this.jobtitle=jobtitle;
this.born=born;
}

var fred=new employee("Fred Flintstone","Caveman",1970);
employee.prototype.salary=null;
fred.salary=20000;

Pridėti metodą:

Customer.prototype.GetCommission() = function()
{
 alert('payroll');
}

http://www.w3schools.com/jsref/jsref_prototype_string.asp


Error.prototype

Error.prototype - pristatomas klaidos konstruktorius.


Error prototype turi šias savybes:



https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error/prototype

CSS legal color values

Colors in CSS can be specified by the following methods:
  • Hexadecimal colors
  • RGB colors - rgb(red, green, blue), reikšmės nuo 0 iki 255, procentais - 0% iki 100%. PVZ.: rgb(0,0,255) ir rgb(0%,0%,100%).
  • RGBA colors - išplėstas RGB, pridedant alpha savybę: rgba(red, green, blue, alpha). alpha parametras nurodo skaitinę reikšmę nuo 0.0 (visiškai permatoma) ir 1.0 (visiškai nepermatomas).
  • HSL colors - nurodo cilindrinius koordinačių atspalvius, hsl(hue - atspalvis, saturation - sodrumas, lightness - lengvumas). #p1 {background-color:hsl(120,100%,50%);} / * green */
  • HSLA colors - išplėstas HSL, pridedant alpha savybę.
  • Predefined/Cross-browser color names - yra apibrėžta 140 spalvų vardų: http://www.w3schools.com/cssref/css_colornames.asp
Šešioliktainiai spalvų kodai: #RRGGBB, kur RR (red - raudona), GG (green - žalia) and BB (blue - mėlyna). Visos reikšmės gali būti nuo 0 iki FF.

http://www.w3schools.com/cssref/css_colors_legal.asp

Callback gražinti XML duomenis


calback.call(httpRequest.responseXML);

call - naudojamas iškviesti objektą. call([thisObj[, arg1[, arg2[, argN]]}])
responseXML - grąžina duomenis kaip XML duomenis

XMLHttpRequest -leidžia atnaujinti puslapio dalis, neperkraunat puslapio.


input type="email"

SVG - interactive scalable vector graphic

transform - apibrėžia sąrašą transformacijų
setInterval - įvertiną išraišką specialiam intervale (milisekundėmis)

myGraphic.setAttribute("currectScale", 1.5)

JQuery show() vs. visible

$('#btnEdit').show()

$(selector).show(speed,easing,callback)

Su display:none naudoti show()? show(), hide() dirba su display savybe, o ne visibility

Matomi elementai yra tie, kurie:
  • nenurodyta display: none
  • nėra tipo type=hidden
  • plotis ir ilgis nėra 0
  • nėra paslėpto elemento dalis

autocomple

autocomplete atributas nurodo, kad laukas gali būti užpildytas automatiškai???

< input type = 'password' required autocomplete = 'off' />

JQuery pažymėti visus header elementus


$(":header")

CSS text-transform property

p.uppercase {text-transform:uppercase;}
p.lowercase {text-transform:lowercase;}
p.capitalize {text-transform:capitalize;}

hyphens


hyphens - teksto lygiavimas, kai į eilučių pabaigą žodis dalijamas ir atskiriamas brūkšneliu


 hyphen geriau nei word-break.

CSS3 hyphen veikia nuo Firefox 6 su anglų kalba.

SVG


SVG yra kalba, apibrėžianti 2D grafiką XML.

Canvas SVG
  • Resolution dependent
  • No support for event handlers
  • Poor text rendering capabilities
  • You can save the resulting image as .png or .jpg
  • Well suited for graphic-intensive games
  • Resolution independent
  • Support for event handlers
  • Best suited for applications with large rendering areas (Google Maps)
  • Slow rendering if complex (anything that uses the DOM a lot will be slow)
  • Not suited for game applications

$.ajax settings: accepts, contentType, dataType

accepts - nurodo, kokio tipo atsakymus leidžia grąžinti
contentType - pagal nutylėjimą 'application/x-www-form-urlencoded; charset=UTF-8'
dataType - galimos reikšmės xml, json, script, html



dataFilter - apvalymo, filtravimo funkcija, kad gautume reikiamus "švarų" atsakymą.


getResponseHeader - headerio informacija apie atsakymą, pvz., 

xmlhttp.getResponseHeader("Server")
xmlhttp.getResponseHeader("Content-Type")
xmlhttp.getResponseHeader("Content-Length")
xmlhttp.getResponseHeader("Last-Modified")


2014 m. balandžio 30 d., trečiadienis

70-480:Įvairūs klausimai

createObjectURL - iš File API

createObjectURL - eksperimentinė technologija, kai iš nuorodos į failą sukuriamas objektas.

objectURL = URL.createObjectURL(blob);
blob- Is a File object or a Blob object to create a object URL for.


Objektas gali būti "atlaisvintas" objectURL.revokeObjectURL.


XMLHttpRequest atsakymui iš serverio naudoja response, responseText, responseXML.
response - paima atsakymo duomenis
responseText - paima atsakymo duomenis kaip tekstą
responseXML - paima atsakymo duomenis kaip XML

HTML5 atributai



onblur - atsitinka, kai naudotojas nuima focus (lose focus);
onfocus - atsitinka, kai naudotojas uždeda focus (HTML).

onfocus priešingas onblur

onreset - įvyksta, kai paspaudžiamas reset mygtukas (HTML);
onselect - įvyksta, kai kas nors būna pažymėta input elemente (HTML).

Position static vs. absolute

position: static|absolute|fixed|relative|initial|inherit;

Pagal nutylėjimą - static.

2014 m. sausio 21 d., antradienis

JQuery: unload event, JavaScript: onbeforeunload event

Problema: pagauti įvykį, kad su window.open atidarytas langas uždaromas ne mygtuko paspaudimu, o pasirinkus dešiniajame viršutiniame kampe esantį mygtuką.

Sprendimas: naudoti unload event - lango užsarymo metu

 $(window).unload(function () {
            alert("Handler for .unload() called.");
        });



Arba naudoti onbeforeunload, prieš uždarant langą:

window.onbeforeunload = function () {
            return 'You have unsaved changes!';
        }

http://api.jquery.com/unload/ - JQuery įvykis

http://help.dottoro.com/ljhtbtum.php - onbeforeunload IE įvykis



http://help.dottoro.com/ljfvvdnm.php - visi įvykiai