Northeast PHP 2013

Introducción a AJAX para programadores PHP

Larry Ullman  · 

Presentación

Vídeo

Transcripción

Extracto de la transcripción automática del vídeo realizada por YouTube.

I'll like a masculine for all at landing page finger quit working groups is helpful when audience members whistle areola you see them here in Seoul lettering is software and web developer is the author of 23 vultures constantly oh I someone I recognize

some familiar faces if you r at my station this morning this is actually the same one just came too much work I'm kidding but tomorrow for my third free station I'm not getting it ah so the time of this is ain't Jax you can put to this is a beginner's

guide technical presentations beginner's guide to Ajax and JavaScript like if you already know how to do a jets or actually probably popped with the learner today I really offended if you order something go somewhere else very much any beginner's guide

to this is how you do it so speak now or forever hold your peace if you want to bolt you can bolt there's no screen all right anybody anybody alright so we're all here as anybody actually thought a tax incentive saying you've done yeah I didn't

very comfortable with it okay copy here's some joy about javascript javascript runs in the browser I can see any JavaScript working on woman anywhere if I'm curious value do something just take a look at copy yeah that's how I word margin hi anybody

else have tinkered with a taxable event I gather yes so okay so hopefully i can do a good job today explaining what it is and how you do it simply put it's really want to be most important developments in the history of well i mean everything that you

think of today in terms of dynamic sites and if you want to use that horrible label web two point oh and ajax of web pages were originally websites were originally static HTML files and had mentally edit like a work of then we had by mac PG driven pages and

that was great well javascript took everything to the next level so basically a doctrine is ajax I'm sorry a Texas kind of hard to explain a decent words basically you can make a behind-the-scenes request of a server in a way that the user doesn't

actually know right so so it makes a web browser behave more like a desktop application instead the user having to actually submit a form and seeing that reload or click a link or whatever you can do all this excited so using agents it can be kind of hard

to grasp but once you get the pond fundamental concept now most of Ajax is the same over it is pretty much expected to be part of holes every website today so if you are going to don't forget capacity or you're curious kind of do need to get so I've

got four parts to this presentation and they spend a few minutes on each first on another concept second I'm going to go to the server side of things and onto the client side and finally depend upon time moving poor this is the core functionality here

this is where you go next I don't know if I'm going to get to that but I want two items if you have any questions along the way I normally don't do this but why don't you ask in the moment that way you don't get to the end of the presentation

say and that good slide there was a bit of code and you have any questions along the way you want to raise our hands or just call them out I really was expecting question right now I let's raise your hand and I should acknowledge you and if I don't

said yeah oh yeah so as I have kind of plans I here man gets to this but for some of you guys might be placed over point any time so to write more code you can happen so we're going to make sure you want to share this part if you have questions let me

know so I can make sure you in shape a lot of this material is actually explained in the next chapter of my javascript book which looks remarkably like that lincoln still here can I do we get difficult hey get away Natasha book all right look at that because

yeah as it turns out he's going to look for me to give away let's switch here's a book but now I have come badness recently who gets it whoever says the most flattering so okay but it has to be sincere I like your hair well as the people this morning

group already hurt um yeah the hotel's got this volume I volumizing shampoo that's really kind of okay so a lot of the material is also covered in this book which looks a lot like this so if i'll give this away somehow today and if you like and

you're curious about learning more i would appreciate if you consider this if you want to spend the money go to your library you know that's fine too don't download it so let's look at the beginning the fundamental concept concepts of ajax

um when i first wrote about Ajax i think of my 2006 i had a tech reviewer kind of say i don't get which was mostly that it's really hard to get in print but you know the thing is you actually ajax is kind of all around us at this point I'm if you

use the website without Ajax you would be kind of stunned by how laminates but let's look at what it means and how it differs from the normal approach this term first came up in 2005 asynchronous JavaScript and XML 8x it's a great asynchronous you're

doing something eighty synchronous it's actually a label that was given the functionality that's been around for more than decades since I think 2000 this capability has been in browsers for a long time this guy just came up with the label in 2005

said hey there's this um today XML is actually not used very often and packed the guy who created the acronym says it's no longer an acronym that Ajax just means Ajax I personally don't think you can uh nak redeem an acronym but you know I think

it just seems weird but the most important thing to know is that Ajax is just something you can do with JavaScript you're using javascript to do a specific thing using function ality that's built into every browser for over a decade so sometimes as

I really have I'm going to slip up and saying JavaScript as opposed to Ajax and vice versa Ajax is a subset of what you can do with JavaScript why I'm looking over here enough stuff to look at let's look at the traditional approach this is a very

complex image rejection comes off better than I was worried it would on the screen so in the old model you have the client you have the server the client is the browser the user's computer the user would make a request of the server the server says hey

they want this page and it sends them the HTML and the images in the JavaScript the page the browser then loads that page the user felt it out click Submit at that point I'm that it goes to the server and you would actually see in the browser you'd

see your little whatever icon that shows it's made a request it's loading information all right it's a very overt request for something from the server and the server would do validation or whatever if it's not you'd have to send the paint

back with the error messages in line on the red formatting the browser would have to download all of that content again and then we draw the page and that process would continue until it was actually filled out correctly and the server would then move on okay

it's a traditional approach I guess the main thing is I like to say it's over you actually see something happening in the browser when this is all taking place now this gets ugly but it's actually a really good thing so what we do with Ajax is

we essentially hijack the default process okay so normally the form submission would go from the browser to the server but instead the javascript is going to say hey a whole lot of it let me check this out and the javascript in the client in the browser can

do whatever validation say just make sure it's not the loud completely right you can do that javascript in the browser a javascript in the browser can't check the server to see if the email address has already been registered or a username has already

forged it can't validate your login credentials you can't do any of that in the browser you have to go to the server so you can use javascript via Ajax to do that so behind the scenes the JavaScript actually requests the server resource and then handles

and what happens is as far as the user knows they've clicked submit the JavaScript does its thing if there's an error the JavaScript and then update the page the user has never left their browser window it didn't have to redownload the HTML again

and it happens generally pretty quick I think the easiest way to think about it is that you are kind of hijacking the normal process things you can do that's form validation and form handling which is one of the most important things but you know Google

[ ... ]

Nota: se han omitido las otras 4.375 palabras de la transcripción completa para cumplir con las normas de «uso razonable» de YouTube.