Prenumeruok RSS

Straipsniai pagal gairę

Ajax manual

Visai įdomus sprendimas ir idėja nebloga, nors paprasta. Patestuokite patys, kolkas supranta PHP, Mysql, Javascript, Css.

Ajax klaidos

Turbūt iš senesnių postų aiškų, kad aš webinių aplikacijų gerbėjas. Bet, kaip ir kiekvienas sprendimas turi savų minusų. Štai kokias klaidas AJAX sistemų apibudina SourceLabs svetainė.

Tikrai tingiu versti. Tad sorry:

  1. Not giving immediate visual cues for clicking widgets.

    If something I’m clicking on is triggering Ajax actions, you have to give me a visual cue that something is going on. An example of this is GMail loading button that is in the top right. Whenever I do something in GMail, a little red box in the top right indicates that the page is loading, to make up for the fact that Ajax doesn’t trigger the normal web UI for new page loading.

  2. Breaking the back button

    The back button is a great feature of standard web site user interfaces. Unfortunately, the back button doesn’t mesh very well with Javascript. Keeping back button functionality is a major reason not to go with a pure Javascript web app.

  3. Changing state with links (GET requests)

    As I’ve referenced in a previous posting, Ajax applications introduce lots of problems for users who assume GET operations don’t change state. Not only do state changing links cause problems for robots, users who are accustomed to having links drive navigation can become confused when links are used to drive application state changes.

  4. Blinking and changing parts of the page unexpectedly

    The first A in Ajax stands for asynchronous. The problem with asynchronous messages is that they can be quite confusing when they are pop in unexpectedly. Asynchronous page changes should only ever occur in narrowly defined places and should be used judiciously, flashing and blinking in messages in areas I don’t want to concentrate on harkens back to days of the html blink tag.

  5. Not using links I can pass to friends or bookmark

    Another great feature of websites is that I can pass URLs to other people and they can see the same thing that I’m seeing. I can also bookmark an index into my site navigation and come back to it later. Javascript, and thus Ajax applications, can cause huge problems for this model of use. Since the Javascript is dynamically generating the page instead of the server, the URL is cut out of the loop and can no longer be used as an index into navigation. This is a very unfortunate feature to lose, many Ajax webapps thoughtfully include specially constructed permalinks for this exact reason.

  6. Too much code makes the browser slow

    Ajax introduces a way to make much more interesting javascript applications, unfortunately interesting often means more code running. More code running means more work for the browser, which means that for some javascript intensive websites, especially poorly coded ones, you need to have a powerful CPU to keep the functionality zippy. The CPU problem has actually been a limit on javascript functionality in the past, and just because computers have gotten faster doesn’t mean the problem has disappeared.

  7. Inventing new UI conventions

    A major mistake that is easy to make with Ajax is: ‘click on this non obvious thing to drive this other non obvious result’. Sure, users who use an application for a while may learn that if you click and hold down the mouse on this div that you can then drag it and permanently move it to this other place, but since that’s not in the common user experience, you increase the time and difficulty of learning your application, which is a major negative for any application.

  8. Not cascading local changes to other parts of the page

    Since Ajax/Javascript gives you such specific control over page content, it’s easy to get too focused on a single area of content and miss the overall integrated picture. An example of this is the Backpackit title. If you change a Backpackit page title, they immediately replace the title, they even remember to replace the title on the right, but they don’t replace the head title tag with the new page title. With Ajax you have to think about the whole picture even with localized changes.

  9. Asynchronously performing batch operations

    Sure with Ajax you can make edits to a lot of form fields happen immediately, but that can cause a lot of problems. For example if I check off a lot of check boxes that are each sent asynchronously to the server, I lose my ability to keep track of the overall state of checkbox changes and the flood of checkbox change indications will be annoying and disconcerting.

  10. Scrolling the page and making me lose my place

    Another problem with popping text into a running page is that it can effect the page scroll. I may be happily reading an article or paging through a long list, and an asynchronous javascript request will decide to cut out a paragraph way above where I’m reading, cutting my reading flow off. This is obviously annoying and it wastes my time trying to figure out my place.

PHP ir JavaScript draugystė

Galit nemėgti JavaScript, bet faktas kad jis reikalingas. Kai kurie sako kad panaudojimas turi būti saikingas. Taip be abejo saikingas, tik kai kuriuose vietuose. Ta prasme public. O jau kažkokiems vidiniams reikalams (tarkim Turinio valdymo sistemai, Informacinė sistema aka CRM), galima jau kelti daug didesnius reikavimus naršyklėms. Seniau prieš keletą metų daug daugiau funkcijų buvo (nors ir dabar yra) pas IE. Ačiū dievui, kad kiti tobulėja JS pusės atvžilgiu.

Vienas iš panaudojimų mano nekart minėtas
XMLHttpRequest . Juo pasinaudojus galima perduoti duomenis iš JS atlikti veiksmus jau serverio pusėje, bei gražinti duomenis. Vienas variantų atlikti paiešką, neperkrovus puslapio. (P.S nuoroda galiete rasti ka tik paminėtam puslapyje, jei netingite surasit).

Neseniai SitePoint radau keletą įdomių staipsnių šiame tema. Tiksliau galima pasakyti tas pats straipsnis tik su pratesimu “Crouching Javascript, Hidden PHP” apie tai galima paskaityti čia ir pratęsti poto skaitymą čia. Labai įdomus pavyzdukas su XML ir XMLHTttpRequest kur parodoma, kaip veikia sincroninis ir asinhronis veikimas. beja veikia ir IE, ir FireFox…

Kodėl mano nuomone panaudojimas reikalingas? Iš vienos pusės supaprastėja programavimas, jau vidinių dalykėlių. Žinoma jau tada reikia suprasti (ne mokėti…) JavaScript. Kita pusė sutaupoma taip vadinamo bandwidžo :). Juk nereikia antrą, trečia kartą krauti paveiksliukų ir pan.  Kitas dalykas padedantis sutaupyti srauto, bei žinoma iterektyvumo panaudojimas įvairūs DHTML elementų tweakai. tipo sortable table, ir pan. Aš tiesa pasakius svaigstu nuo tokių dalykėlių kaip behaviuors panaudojimų, pvz vienas iš jų Stedy (gaila veikia tik ant IE), webFX, bindows (o jau 1.2 versija išėjo) ir pan. Gal ir blogis kai kam, kad daugelis atrodo kaip windowsų interveisas, bet manau daugeliam eilinių naudojtojų, tai būtų labiau suprantama.

Galbūt didžiausias minusas kuriant WEB srityje dirbančioje firmoje – tokių advanced javascriptų naudojimą supras tikrai nedaug žmonių. Tad tobulinti sistemą dažniausia teks vienam žmogeliuikui. O jei jis išeis… uch kas būtų…

 

XMLHttpRequest

Galbūt nevisi žino kas yra XMLHttpRequest. Buitiškai galiu
apibunti tai kaip būdą, su kuriuo įmanoma gauti naujus duomenis (tarkim kažkokį tekstą) be taip vadinamo refresho. Šis dalykėlis mane tiesa
paskius labai žavi. Seniau jis veikė tik pas M$ Internet Explorer, nes naudojamas AtiveX. Bet naujausios naršyklės jau ir jį palaiko.
Ką galima pridirbti? Pasinaudojus šia technologija pavyzdžiui yra padaryta mano labai mėgstama turinio valdymo sistema Sitesupra,
tarkim vienas žmogeliukas savo webloge pasidarė paiešką LIVESEARCH. Babandykit vesti tekstą į
paieškos laukelį išlėto, ir suprasite panaudojimo privalumus. (veikia tiek IE, tiek FireFox). Seniau rašiau apie Bindows sistemą,
ji irgi turi savyje šią savybę.

Žinoma ši technologija neptaiks tiems kas nekenčia, nemyli JavaScripto.

Bindows

Mane žavi, tai kas gali suprogramuota, įpač jei to nesitiki, kad
įmanoma. Su JavaScript, kurių turbūt daugelis nemėgsta, galima ulialia
ko nuveikti, schreenshotą turbūt matote. Kiek žiūrėjau velniškai daug
gerų idėjų, o suprasti kaip padaryta.. dar nespėjau. Nes ten labai jau
objektiškai padaryta… reikia ilgai narptyti kodą. Tiesa
didžiausiausias funkcialumas ant IE, bet ir mozilla nebus
nuskriausta.. veikia, tik su keletą apribojimų. aplankyti šį stebuklą
galite Bindows.net. Keletas
pavyzdžių kas atlikta su šiuo freimworku: Forumas,
Mysql (mini) adminas ir t.t.
Vos nepamiršau čia objektų informacija skaitoma iš XML :)

Bežiūrėdamas aiksčiuojau iš nuostabos.. Tikrai padirbėta iš širdies. Bet pažiūrėjus į kainą… linksma pasidaro :)

> home
  • Apie mane
  • Apklausos
  • Blogas
  • Lietblogs Search
  • Nuorodos
  • Reklama mano bloge
  • Search
  • Tags
  • Testas
  • Projektai
  • Kontaktuok
  • Archyvas