Mootools a Web Developer Experience

Total Page:16

File Type:pdf, Size:1020Kb

Mootools a Web Developer Experience MooTools A Web Developer Experience An Introduction to the javascript framework, MooTools! JavaScript != Java “Java and Javascript are similar like Car and Carpet are similar.” – Greg Hewgill JavaScript Runs… • Javascript is run in a browser, but can be found other places like… Apple Dashboard widgets, Adobe Apps, Text-editor extensions, Flash & More... • Unlike Java, there is no official runtime; each browser has its own implementation TraceMonkey (Firefox 3.5), V8 (Chrome), SquirrelFish (Safari), Carakan (Opera 10.50), Chakra (IE9) JavaScript Java • Untyped variables • Typed variables • Function Based Scope • Block Based Scope • Prototypical Inheritance • Classical Class-based Inheritance • Constructors are regular functions • Constructors are special pseudo- methods • Implicit Global Scope • Implicit this attached to non-static member methods Some Jifferences Differences Just enough to get around JAVASCRIPT SYNTAX OVERVIEW Variables Variables have no named types, but there are types: strings, integers, floats, arrays, booleans and objects. var aString = "stringy string string"; var aNumber = 1337; var aFloat = 1337.314; var anArray = ["pirates", "ninjas", "penguins"]; var aBoolean = true; var anObject = {name: "ryan", age: 17}; var anElement = $("myBox"); Syntax: var varName = varValue; Functions Functions are globally accessible; methods are attached to an Object. function myMethod(param1, param2) { return param1 + (param1 * param2); } There are no return types, there are no parameter types. Obviously, this has something to do with numbers though. Strange Functions Functions are actually like variables in a way; you can pass them into other functions. function runAFunctionToday(fn) { return fn(2, 4); } function myMethod(param1, param2) { return param1 + (param1 * param2); } runAFunctionToday(myMethod); // returns 10 The myMethod function is passed to the runAFunctionToday function and inside, is supplied the proper parameters to run. Look, No Hands Class! Again, variables and functions globally available. var someVar = "ipad"; function aFunction() { var x = "meet"; thing = "verizon"; return someVar + ", " + x + thing; } // aFunction returns "ipad, meet verizon" // "x" variable is no longer accessible, but "thing" is a global variable now. Object Literals Java Script provides an incredibly useful construct called an Object Literal (or “object” for short). This is similar to a Java HashMap. var myObject = {aVar: "aValue"}; var myObjectFns = { aProperty: "see?", aMethod: function(aParam) { return aParam + "arr" + myObject.aVar; } }; And all The Stuff You Already Know You already know about if/else and loops, because you know Java. var x = 10, y = 5; if (x < y) { // something } else { // something else } var arr = ["h", "e", "l", "l", "o"]; for (var i = 0; i < arr.length; i++) { var letter = arr[i]; } A Javascript Master Can you believe you’ve mastered Javascript already? That’s all there is to JS since you already know Java. Questions? <open> … </close> A QUICK HTML STOP Dividers as Blocks There are HTML elements, they make up webpages. Elements have IDs and Classes. These are used as hooks. <div id="myDiv" class="myCoolStuff">My really cool stuff div!</div> Notice the div part, that’s a block, or a square. It holds things. myDiv is the ID of the div, myCoolStuff is the class of the div. Notice that you <open> and </close> the div? Links Links are important in HTML. They can be clicked. <a href="http://google.com/search?q=pirates">Search Google for Pirates</a> That makes an underlined clickable piece of text: Search Google for Pirates Input Input is easy too. <input type="text" id="myname" /> <input type="submit" id="go" /> Done with HTML Already! You’re not a master with HTML yet, but this is enough to get the job done for now. Questions? I mean, MooTools MY OBJECT ORIENTED TOOLS The Moo in MooTools MOO: My Object Oriented – Tools MooTools is a library that allows developers to write code in a familiar Object Oriented manner (because javascript is not object oriented in the way we know it). MooTools also adds loads and loads of enhancements to otherwise boring webpages, such as dynamic loading and fancy effects (think fades, rescaling and so on). Where to Learn This For Real This Mirco-Introduction will not tell you everything you need to know, like HTML, CSS and Java Script. But it will get you started. That’s all. Two years ago, I started the mooWalkthrough, a walk-through-style wiki designed to guide beginners in their MooTools endeavors. Check it out! walkthrough.ifupdown.com The mooShell – mootools.net/shell A live testing environment for MooTools javascript, complete with tabbing and highlighting support, completely browser based. All of the examples during this presentation can be tested-out-live by using the MooShell: enter the code into the correct box and hit run & watch the result. You know… Coding…? SOURCE CODE TIME Imagine a box… Let’s say it’s a div with the ID of myBox. <div id="myBox">your little box</div> What if we wanted that box to become red? We’d do this: $("myBox").setStyle("background-color", "red"); What if we wanted that box to have blue borders? $("myBox").setStyle("border", "1px solid blue"); How about some white text now? $("myBox").setStyle("color", "white"); Elements in Variables var box = $("myBox"); // You can store your <div id="myBox"> reference in a variable Interaction Let’s say there’s a button (link) <a id="myButton" href="#">Greenify</a> We want this button to make our box become green when we click the link. How? MooMagic™. $("myButton").addEvent("click", function(){ $("myBox").setStyle("background-color", "green"); }); A Fading Box… Now, instead of having a button, we want the box to fade away when the mouse is over it and fade in when the mouse is not over it. (Imagine this in Greenfoot!) $("myBox").addEvent("mouseenter", function(){ this.tween("opacity", 0); // fade out }); $("myBox").addEvent("mouseleave", function(){ this.tween("opacity", 1); // fade in }); You’ve Experienced the 3 – E’s of JS The Three E’s of Java Script are: Elements, Events and Effects. $("get-an-element"); // gets an element by ID $("someElement").addEvent("someEvent", function(){/* some kind of event */}); $("someElement").tween("some-style", "some new end-result style"); Questions? Adding text to Elements Adding text to elements is easy too. $("myBox").set("html", "Hi there, how are you?"); Adding Lots of Dynamic Text… But if you have bunch of variables that help shape a string, how about a different method? var subs = { name: "ryan", age: 17, awesome: ( Math.random()<.5?"is":"is not") + "awesome" }; var str = "{name} is {age} and {awesome}!"; $("myBox").set("html", str.substitute(subs)); Creating elements With MooTools, creating elements on demand is a breeze. var myElement = new Element("div"); myElement.set("html", "I am new"); myElement.setStyle("border", "1px solid #519CE8"); $("myBox").grab(myElement); Getting Elements You already know about the regular method to get an element: $("someElementID"); // returns the reference to the element that id=someElementId Instead of giving IDs to every single element you want to target, you can use some auxiliary methods. $("anyElement").getElement("any css selector"); // examples .getElement("span"); .getElement("a"); .getElement("input[type=text]"); Delays and Periodicals You can set a function or method to execute after a set period of time, using delay. You can also have a function or method execute repeatedly after a set period of time, using periodical. function goRed() { $("myBox").setStyle("background-color", "red"); } function goGreen() { $("myBox").setStyle("background-color", "green"); } goRed.delay(2000); goGreen.periodical(5000); Each You can use a regular loop in javascript, sure, but a MooTools each loop is so much more fun. var students = ["ryan", "nate", "john", "neal", "hui", "matt"]; // Obviously, comment one loop out for testing. for (var i = 0; i < students.length; i++) { $("myBox").set("html", $("myBox").get("html") + "<br />" + students[i]); } students.each(function(student){ this.set("html", this.get("html") + "<br />" + student); }, $("myBox")); Finished Utils, Now Classes You’ve covered a lot of the Utilities now like “each” and “delay”. MooTools offers a lot of convenience, but it also offers the classical class approach that we all love. Questions? Your eyes may bleed a little WHY PROTOTYPICAL INHERITANCE SUCKS You believe me, right? function Person(dob) { this.dob = dob; } var F = function(){}; Person.prototype.votingAge = 21; F.prototype = Person.prototype; Person.prototype.doWork = Developer.prototype = new F(); function(hours) { Developer.prototype.__super = var hoursOfWork = 5 * hours; Person.prototype; return hoursOfWork; Developer.prototype.votingAge = 18; } function Developer(dob, skills) { this.dob = dob; this.skills = skills; } And totally spoils us too BUT MOOTOOLS SAVES US MooTools Classes / 1 / Base Since Java Script does not have classes as we (Java Programmers) know, MooTools allows us to write as if Java Script did. var Person = new Class({ votingAge: 21, initialize: function(dob) { this.dob = dob; }, doWork: function(hours) { var hoursOfWork = 5 * hours; return hoursOfWork; } }); MooTools Classes / 2 / Subclass Using the Person as a base class, it is easy to extend other classes with MooTools. var Developer = new Class({ Extends: Person, votingAge: 18, initialize: function(dob, skills) { this.dob = dob; this.skills = skills; }, doWork: function(hours) { var time = this.parent(hours); if ( $type(this.skills)
Recommended publications
  • Pragmatic Guide to Javascript
    www.allitebooks.com What Readers Are Saying About Pragmatic Guide to J a v a S c r i p t I wish I had o w n e d this book when I first started out doing JavaScript! Prag- matic Guide to J a v a S c r i p t will take you a big step ahead in programming real-world JavaScript by showing you what is going on behind the scenes in popular JavaScript libraries and giving you no-nonsense advice and back- ground information on how to do the right thing. W i t h the condensed years of e x p e r i e n c e of one of the best JavaScript developers around, it’s a must- read with great reference to e v e r y d a y JavaScript tasks. Thomas Fuchs Creator of the script.aculo.us framework An impressive collection of v e r y practical tips and tricks for getting the most out of JavaScript in today’s browsers, with topics ranging from fundamen- tals such as form v a l i d a t i o n and JSON handling to application e x a m p l e s such as mashups and geolocation. I highly recommend this book for anyone wanting to be more productive with JavaScript in their web applications. Dylan Schiemann CEO at SitePen, cofounder of the Dojo T o o l k i t There are a number of JavaScript books on the market today, b u t most of them tend to focus on the new or inexperienced JavaScript programmer.
    [Show full text]
  • THE FUTURE of SCREENS from James Stanton a Little Bit About Me
    THE FUTURE OF SCREENS From james stanton A little bit about me. Hi I am James (Mckenzie) Stanton Thinker / Designer / Engineer / Director / Executive / Artist / Human / Practitioner / Gardner / Builder / and much more... Born in Essex, United Kingdom and survived a few hair raising moments and learnt digital from the ground up. Ok enough of the pleasantries I have been working in the design field since 1999 from the Falmouth School of Art and onwards to the RCA, and many companies. Ok. less about me and more about what I have seen… Today we are going to cover - SCREENS CONCEPTS - DIGITAL TRANSFORMATION - WHY ASSETS LIBRARIES - CODE LIBRARIES - COST EFFECTIVE SOLUTION FOR IMPLEMENTATION I know, I know, I know. That's all good and well, but what does this all mean to a company like mine? We are about to see a massive change in consumer behavior so let's get ready. DIGITAL TRANSFORMATION AS A USP Getting this correct will change your company forever. DIGITAL TRANSFORMATION USP-01 Digital transformation (DT) – the use of technology to radically improve performance or reach of enterprises – is becoming a hot topic for companies across the globe. VERY DIGITAL CHANGING NOT VERY DIGITAL DIGITAL TRANSFORMATION USP-02 Companies face common pressures from customers, employees and competitors to begin or speed up their digital transformation. However they are transforming at different paces with different results. VERY DIGITAL CHANGING NOT VERY DIGITAL DIGITAL TRANSFORMATION USP-03 Successful digital transformation comes not from implementing new technologies but from transforming your organisation to take advantage of the possibilities that new technologies provide.
    [Show full text]
  • Qooxdoo Interview Questions and Answers Guide
    Qooxdoo Interview Questions And Answers Guide. Global Guideline. https://www.globalguideline.com/ Qooxdoo Interview Questions And Answers Global Guideline . COM Qooxdoo Job Interview Preparation Guide. Question # 1 What is Qooxdoo? Answer:- qooxdoo is an open source Ajax web application framework. It is an LGPL- and/or EPL-licensed multipurpose framework that includes support for professional JavaScript development, a graphical user interface (GUI) toolkit and high-level client-server communication. Read More Answers. Question # 2 Is qooxdoo freely available? Answer:- Yes. qooxdoo is Open Source, dual-licensed under LGPL/EPL, i.e. the "GNU Lesser General Public License (LGPL)" and the "Eclipse Public License (EPL)". As a recipient of qooxdoo, you may choose which license to receive the code under. Read More Answers. Question # 3 Who developed qooxdoo? Answer:- qooxdoo was initiated and is maintained by 1&1, the world's biggest web hosting company. There is a team of full-time core developers as well as many committers and contributors. Read More Answers. Question # 4 Which browsers are supported? Answer:- A qooxdoo application runs in all major web browsers - with identical look & feel. Read More Answers. Question # 5 Does qooxdoo come with a server? Answer:- No. If you already have an existing backend that serves HTTP (or HTTPS) requests, it's probably fine to continue using it. Optionally qooxdoo offers several RPC servers for an elegant client-server communication. BTW, during development of your client application the local file system often is sufficient, without the need to use a real server. Read More Answers. Question # 6 What languages and technologies do we need to know? Answer:- Not many.
    [Show full text]
  • Resources for Application Developers All of the Links Below Are External
    Resources for Application Developers All of the links below are external websites. You MUST verify that each resource, code snippet, tutorial, or library is fully accessible. These resources are not endorsed as fully accessible. HTML WCAG 2.0 Web Accessibility Wizard HTML Tutorials and More From W3Schools (HTML5, CSS, JavaScript, XML, AJAX, PHP, etc.) Web Standards Group (web coding resources) Scripts & Applets Web Accessibility Practices Quick Reference from Web-AIM Yahoo Accessibility Blog The 5 Layers of Web Accessibility Accessibility myths in 2010 .NET Building ASP.NET 2.0 Web Sites Using Web Standards Accessibility in Visual Studio and ASP.NET ASP.NET Controls and Accessibility Walkthrough: Creating an Accessible Web Application Accessibility at Microsoft Accessibility Developer Center - MSDN Java Java Accessibility Utilities Java SE Desktop Accessibility Java Access Bridge Java Accessibility API JLCA 3.0 - Java Accessibility (JAAPI) Swing Chapter 24. (Special topics) Accessibility JavaScript Web Semantics: Accessible JavaScript & CSS Accessible Image and Text Slideshow using JQuery Making AJAX work with Screen Readers Accessible JQuery Tabs Examples Usable and Accessible Form Validation and Error Recovery Understanding Progressive Enhancement Support Detection – simple checks on a browser’s JavaScript object support Creating Accessible JavaScript (Including Event Handlers) iCITA: Scripting Best Practices Progressive Enhancement: What It Is, And How To Use It? Slideshow With Buttons Replacing <noscript>
    [Show full text]
  • Ext-JS Job Interview Questions and Answers
    Ext-JS Job Interview Questions And Answers Interview Questions Answers https://interviewquestionsanswers.org/ About Interview Questions Answers Interview Questions Answers . ORG is an interview preparation guide of thousands of Job Interview Questions And Answers, Job Interviews are always stressful even for job seekers who have gone on countless interviews. The best way to reduce the stress is to be prepared for your job interview. Take the time to review the standard interview questions you will most likely be asked. These interview questions and answers on Ext-JS will help you strengthen your technical skills, prepare for the interviews and quickly revise the concepts. If you find any question or answer is incorrect or incomplete then you can submit your question or answer directly with out any registration or login at our website. You just need to visit Ext-JS Interview Questions And Answers to add your answer click on the Submit Your Answer links on the website; with each question to post your answer, if you want to ask any question then you will have a link Submit Your Question; that's will add your question in Ext-JS category. To ensure quality, each submission is checked by our team, before it becomes live. This Ext-JS Interview preparation PDF was generated at Saturday 6th February, 2021 You can follow us on FaceBook for latest Jobs, Updates and other interviews material. www.facebook.com/InterviewQuestionsAnswers.Org Follow us on Twitter for latest Jobs and interview preparation guides. https://twitter.com/InterviewQA If you need any further assistance or have queries regarding this document or its material or any of other inquiry, please do not hesitate to contact us.
    [Show full text]
  • Javascript for Web 2.0 Development Introduction
    "Web Age Speaks!" Webinar Series JavaScript for Web 2.0 Development Introduction Mikhail Vladimirov Director, Curriculum Architecture [email protected] Web Age Solutions Providing a broad spectrum of regular and customized training classes in programming, system administration and architecture to our clients across the world for over ten years ©WebAgeSolutions.com 2 Overview of Talk Overview of ECMAScript 6 release Hybrid Mobile Web Development Overview of Popular JavaScript libraries: jQuery AngularJS Modernizr _Underscore.js ©WebAgeSolutions.com 3 JavaScript for Web 2.0 Development Some JavaScript Facts Who Owns JavaScript Name The "JavaScript" name is a trademark now owned by Oracle Corporation (US Patent and Trademark Office, copyright entry #75026640). ©WebAgeSolutions.com 5 ECMAScript… JavaScript is un-related to Java It was originally designed by Netscape to add scripting to their browser. It was called 'LiveScript'. Re-naming it to JavaScript was a marketing trick to get more attention to it It is more of a “Lisp in C's Clothing” with elements of functional programming (http://javascript.crockford.com/javascript.html ) Each browser’s JavaScript engine is an attempt to implement ECMAScript standard (first draft in 1997) Well-known implementations are JavaScript, JScript and ActionScript ©WebAgeSolutions.com 6 ECMAScript Release 6 (Work in Progress) Classes and modules ( import {func1} from ‘js/mylib’ ) Better variable scoping (let for the new block scope) Multiple return values (return {x, y})
    [Show full text]
  • DOM: Document Object Model
    DOM: Document Object Model • browser presents an object interface – accessible from and modifiable by Javascript • DOM entities have methods, properties, events – element properties can be accessed & changed – elements can be added or removed • document object holds page contents – elements stored in a tree: HTML tags, attributes, text, code, ... – each element is accessible through the DOM – through functions called from Javascript • page is "reflowed" (smart redraw) when anything changes • window object also has methods, properties, events – alert(msg), prompt(msg), open(url), ... – size, position, history, status bar, ... – onload, onunload, ... – window.document: the document displayed Basic events on forms <head> <script> function setfocus() { document.srch.q.focus(); } </script> </head> <body onload='setfocus();'> <H1>Basic events on forms</H1> <form name=srch action="http://www.google.com/search?q="+srch.q.value> <input type=text size=25 id=q name=q value="" onmouseover='setfocus()'> <input type=button value="Google" name=but onclick='window.location="http://www.google.com/ search?q="+srch.q.value'> <input type=button value="Wikipedia" name=but onclick='window.location="http://en.wikipedia.com/ wiki/"+srch.q.value'> <input type=reset onclick='srch.q.value=""' > </form> More examples... • in a form: <form> <input type=button value="Hit me" onClick='alert("Ouch! That hurt.")'> <P> <input type=text name=url size=40 value="http://"> <input type=button value="open" onClick='window.open(url.value)'> <P> <input type=text name=url2 size=40 value="http://"> <input type=button value="load" onClick='window.location=url2.value'> <P> <input type=button value="color it " onClick='document.bgColor=color.value'> <input type=text name=color value='type a color'> <input type=button value='make it white' onClick='document.bgColor="white"'> </form> • in a tag <body onLoad='alert("Welcome to my page")'> • on an image <img src="smiley.jpg" onMouseover='src="frowny.gif"' onMouseout='src="smiley.jpg"'> • etc.
    [Show full text]
  • Mootools-1.2-Beginners-Guide.Pdf
    MooTools 1.2 Beginner's Guide Learn how to create dynamic, interactive, and responsive cross-browser web applications using one of the most popular JavaScript frameworks Jacob Gube Garrick Cheung BIRMINGHAM - MUMBAI This material is copyright and is licensed for the sole use by ALESSANDRO CAROLLO on 18th December 2009 6393 south jamaica court, , englewood, , 80111 MooTools 1.2 Beginner's Guide Copyright © 2009 Packt Publishing All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews. Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the authors, Packt Publishing, nor its dealers or distributors will be held liable for any damages caused or alleged to be caused directly or indirectly by this book. Packt Publishing has endeavored to provide trademark information about all the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information. First published: December 2009 Production Reference: 1111209 Published by Packt Publishing Ltd. 32 Lincoln Road Olton Birmingham, B27 6PA, UK. ISBN 978-1-847194-58-9 www.packtpub.com Cover Image by Vinayak Chittar ([email protected])
    [Show full text]
  • Choosing the Best Javascript Framework
    Choosing the Best JavaScript Framework Andy Gup, Esri US Raul Jimenez, Esri ES Frameworks, frameworks, … Do I even need a framework?? Has.jsRaphael The Boiler BootstrapLess+ DojoWirefy Foundation 3 SenchaTitan Susy Skeleton Ingrid jQuery Less Phonegap X X 1991 2012 ECMA 5.1 ECMA 2015 June 2011 June 2015 JavaScript Frameworks & Libraries: Timeline MooTools Kendo Polymer 05/2014 script.aculo.us 09/2006 AngularJS UI 06/2005 2009 04/2014 Kartograph Ionic 08/2013 Phonegap jQuery 2013 2009 08/2006 Backbone Ember.js 10/2013 JavaScriptMVC Knockout 12/2011 YUI 05/2008 02/2006 7/2010 CMV 02/2013 Web Bootstrap AppBuilder Titanium Prototype 04/2011 07/2014 12/2008 2005 ExtJS Ractive 12/2007 08/2013 React native jQuery React.js 03/2015 Dojo Mobile 2013 08/2005 10/2010 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 Event-driven One-Page Discontinued Hybrid Geospatial Trends: Interest over time 2005 - 2007 2007 - 2012 2004 - 2012 Your Considerations • New project or expanding existing project? • Your project size (small, medium, large)? • Do you have existing build system? • Do you have existing frameworks? • Your teams skill sets? • Your requirements? Learning curve Evaluating a framework • Framework 3rd party sponsorship • Major version changes • Documentation • Stackoverflow questions Evaluating a framework Angular.js Mono Evaluating a framework Latest commit … Oct 6, 2011!!! Evaluating a framework Number of: • Closed issues • Open issues • Open pull requests • Contributors Evaluating a framework • Trendiness (cool factor) vs Stable/Secure
    [Show full text]
  • Appendix a Setting up a Local Web Server
    Appendix A Setting Up a Local Web Server It’ll be much easier for you to run the examples in this book if you run them on a local web server. One reason for this is because of a security sandboxing feature that Internet Explorer has for running HTML files that contain JavaScript in them; the other is to replicate the manner in which you will be using Dojo for a real website or web application. Although the Mac OS X operating system includes a built-in web server as do some versions of Windows, I will be going through, step-by-step, how to install a local web server that will serve HTML, JavaScript, and PHP files. You won’t be using the included web servers built into your operating system because of the complex configurations. Instead, you will be using a turnkey solution, one for the Mac called MAMP (which stands for Macintosh, Apache, MySQL, and PHP) or one for Windows known as XAMPP (the X is for the four operating systems it supports; the other letters stand for Apache, MySQL, PHP, and Perl). These two products are great because they give you an extremely easy and straightforward method for quickly setting up a local web server that not only supports serving static files such as HTML and JavaScript files but also supports PHP and database connectivity. The best thing about both of these tools is that they are completely free to download and use. If you are on Windows, you’ll want to skip the next section and jump to “XAMPP on Windows.” MAMP on Mac OS X The latest version of MAMP supports Snow Leopard (OS X 10.6) and older.
    [Show full text]
  • A Web Application Framework for Stage Final Report
    Swan A Web Application Framework for Stage Final Report Fred van den Driessche Imperial College June 14, 2010 Supervisor: Susan Eisenbach Second Marker: Tony Field ♠ Abstract Last year's release of Google Wave enforced an increasingly strong trend of feature-filled, highly inter- active Web applications with Web browsers acting as a thin client. The enhanced execution speed of JavaScript allows the creation of browser-based applications which rival traditional desktop applications in their responsiveness and usability. Such applications eschew rendering the entire page beyond the initial download instead relying on partial interface updates using data from background requests. How- ever, the development of such applications requires a very different style compared to traditional Web applications and varying implementations of JavaScript across browsers makes it hard for developers to create them. Established Web frameworks such as Django tend to focus on the creation of traditional Web applica- tions and often rely on third-party JavaScript libraries for the provision of highly interactive features. Google Web Toolkit concentrates on the creation of an interactive user interface but leaves the implementation of data storage to the user, while Lift provides an Actor-based solution to the problem of scaling to meet the server requirements for such interactivity. This report introduces Swan, a Web application framework based on Stage, a scalable, distributed, Actor language with clean, concise and expressive syntax. Swan uses these features to create a full MVC framework through which users can develop highly responsive, scalable Web applications in a single high-level language. Acknowledgements First and foremost I would like to thank Susan Eisenbach, without whom Swan would simply be an ugly duckling.
    [Show full text]
  • Introduction to The
    Libraries and APIs CMPT 281 Overview • Basics of libraries and APIs • Rich internet applications • Examples – Scriptaculous – JQuery What is a library? • A collection of software modules that provides services to another program • A way to extend the functionality of a programming language • A way to modularize software development Library A Application Library B What is an API? • “Application Programming Interface” • The set of functions or commands that is made available by a library Why libraries for web development? • To improve the interactive experience • Many tasks are difficult with just HTML/CSS – e.g., poor set of interface widgets – Libraries allow reuse of good solutions – “javascript libraries” • Many web services exist on the internet – External libraries with a different delivery model – e.g., Google Maps, Flickr, WeatherBug All libraries have an API JavaScript Libraries JavaScript Libraries Prototype www.prototypejs.org/ script.aculo.us script.aculo.us/ Yahoo! User Interface Library developer.yahoo.com/yui/ Dojo dojotoolkit.org/ jQuery jquery.com/ MooTools mootools.net/ Raphael raphaeljs.net What do JS libraries do? • Animation effects • User interface widgets • JS programming shortcuts • Graphics • AJAX – Asynchronous Javascript And XML • ...and more, depending on the library But, beware... • Libraries can make things more complex • They can change the way JS works • They may not be complete or well supported • They can be difficult to learn (examples!) • So, don’t depend on them! – e.g., only use plain JS on the final
    [Show full text]