Showing posts with label JavaScript. Show all posts
Showing posts with label JavaScript. Show all posts

Saturday, March 1, 2008

Introduction to JavaScript: Hello World

Are you just starting out writing in JavaScript? Learn how to create a program that says 'Hello World' as your first introduction to this computer programming language.

Saturday, February 23, 2008

What is AJAX?

Asynchronous JavaScript And XML, or its acronym Ajax (Pronounced A-JAX), is a Web development technique for creating interactive web applications. The intent is to shift a great deal of interaction to the Web surfer's computer, exchanging data with the server behind the scenes, so that the entire Web page does not have to be reloaded each time the user makes a change. This is meant to increase the Web page's interactivity, speed, and usability. The Ajax technique uses a combination of:

  • XHTML (or HTML) and CSS for marking up and styling information.
  • The DOM accessed with a client-side scripting language, especially ECMAScript implementations like JavaScript and JScript, to dynamically display and interact with the information presented
  • The XMLHttpRequest object to exchange data asynchronously with the web server. In some Ajax frameworks and in some situations, an IFrame object is used instead of the XMLHttpRequest object to exchange data with the web server.
  • XML is commonly used as the format for transfering data, although any format will work, including preformatted HTML, plain text, JSON and even EBML.
Like DHTML, LAMP, or SPA, Ajax is not a technology in itself, but a term that refers to the use of a group of technologies together. In fact, derivative/composite technologies based substantially upon Ajax, such as AFLAX, are already appearing.

History
The earliest form of asynchronous remote scripting, Microsoft's Remote Scripting, was developed before XMLHttpRequest existed, and made use of a dedicated Java applet.

The web development community, first collaborating via the microsoft.public.scripting.remote newsgroup and later through blog aggregation, subsequently developed a range of techniques for remote scripting in order to enable consistent results across different browsers. Early examples are the IFRAME-based JSRS library from 2000, the introduction of the Image/Cookie technique in 2000, and the JavaScript on Demand technique in 2002. In 2002, a user-community modification to Microsoft Remote Scripting was made to replace the Java applet with XMLHttpRequest.

Remote Scripting Frameworks such as ARSCIF surfaced in 2003 not long before Microsoft introduced Callbacks in ASP.NET

Some early articles promoting Remote Scripting techniques:
  • Microsoft Internet Developer Magazine 1998
  • Scott Andrew's XML-RPC example 2001
  • Apple Developer Connection 2002
  • Using the XML HTTP Request object 2002-2006
  • Since XMLHttpRequest is now implemented across the majority of browser marketshare, alternative techniques are used infrequently. However, they are still used where wide compatibility, small implementation, or cross-site access are required.
Pros, Cons & Criticism

Pros

Interactivity
One major complaint voiced against the use of Ajax in web applications is that it might easily break the expected behavior of the browser's back button (see Jakob Nielsen's 1999 Top-10 New Mistakes of Web Design). The different expectations between returning to a page which has been modified dynamically versus the return to a previous static page might be a subtle one. Users generally expect that clicking the back button in web applications will undo their last state change and in Ajax applications this might not be the case. Developers have implemented various solutions to this problem, most of which revolve around creating or using invisible IFRAMEs to invoke changes that populate the history used by a browser's back button. Google Maps, for example, performs searches in an invisible IFRAME and then pulls results back into an element on the visible web page; it is possible to track user behaviour via callbacks which are called whenever the back button is pressed, restoring the application state that existed at the time.

Portability
Ajax applications use well-documented features present in all major browsers on most existing platforms. Though this situation could feasibly change in the future, at the moment, Ajax applications are effectively cross-platform.

While the Ajax platform is more restricted than the Java platform, current Ajax applications effectively fill part of the one-time niche of Java applets: extending the browser with lightweight mini-applications.

Cons & Criticism

Usability Criticisms
One major complaint voiced against the use of Ajax in web applications is that it might easily break the expected behavior of the browser's back button (see Jakob Nielsen's 1999 Top-10 New Mistakes of Web Design). The different expectations between returning to a page which has been modified dynamically versus the return to a previous static page might be a subtle one. Users generally expect that clicking the back button in web applications will undo their last state change and in Ajax applications this might not be the case. Developers have implemented various solutions to this problem, most of which revolve around creating or using invisible IFRAMEs to invoke changes that populate the history used by a browser's back button. Google Maps, for example, performs searches in an invisible IFRAME and then pulls results back into an element on the visible web page; it is possible to track user behaviour via callbacks which are called whenever the back button is pressed, restoring the application state that existed at the time.

A related issue is that the use of dynamic web page updates makes it difficult for a user to bookmark a particular state of the application. Solutions to this problem have likewise begun to appear, many of which use the URL fragment identifier (commonly known as the anchor, or the portion of the URL after the '#') to keep track of, and allow users to return to, the application in a given state. (Many browsers allow JavaScript scripts to update the anchor dynamically, which allows the Ajax application to update it in parallel with the contents of the display.) These solutions also address many of the issues related to lack of back button support.

Response-time concerns
Network latency — or the interval between user request and server response — needs to be considered carefully during Ajax development. Without clear feedback to the user, smart preloading of data, and proper handling of the XMLHttpRequest object users might experience delay in the interface of the web application, something which users might not expect or understand. The use of visual feedback to alert the user of background activity and/or preloading of content and data are often suggested solutions to these latency issues.

In general the potential impact of latency has not been "solved" by any of the Public Domain AJAX toolkits and frameworks available today, such as the effect of latency variance over time.

JavaScript
While no browser plug-in is required for Ajax, it requires users to have JavaScript enabled in their browsers. This applies to all browsers that support Ajax except for Microsoft Internet Explorer 6 and below which additionally requires ActiveX to be enabled along with ActiveScript. The XMLHTTPRequest object used in Internet Explorer is ActiveX. Security settings might cause Internet Explorer to not support Ajax (e.g.: ActiveScript or ActiveX might be disabled). It is possible to use inline frames (IFRAMEs) to avoid this ActiveX problem. Internet Explorer 7, however, exposes XMLHTTP object in the native browser API and hence does not need ActiveX to render AJAX sites.

As with DHTML applications, Ajax applications must be tested rigorously to deal with the quirks of different browsers and platforms. A number of programming libraries have become available as Ajax has matured that can help ease this task. Likewise, techniques have been developed to assist in designing applications which degrade gracefully and offer alternative functionality for users without JavaScript enabled .

Name Issues
There have been some critics of the term Ajax, claiming that Adaptive Path (the consulting firm that coined the term [6]) or other proponents are using it as a marketing vehicle for previously-used techniques.

Accessibility
Using Ajax technologies in web applications provides many challenges for developers interested in adhering to WAI accessibility guidelines. Developers need to provide fallback options for users on other platforms or browsers, as most methods of Ajax implementation rely on features only present in desktop graphical browsers.

Web developers use Ajax in some instances to provide content only to specific portions of a web page, allowing data manipulation without incurring the cost of re-rendering the entire page in the web browser. Non-Ajax users would optimally continue to load and manipulate the whole page as a fallback, allowing the developers to preserve the experience of users in non-Ajax environments (including all relevant accessibility concerns) while giving those with capable browsers a much more responsive experience.

Markup Language vs Programming
The common approach to apply Ajax usually involves extensive programming in JavaScript. Frameworks are then aimed to provide ready-to-use UI (e.g., in HTML or XUL) widgets and libraries to make programming in JavaScript easier.

The major advantage of the declarative approach is that non-programmers are allowed to define user interfaces with HTML-like markup language. The disadvantage is that pages are becoming harder and more obscure to design and maintain, as they become more sophisticated.

Browsers that support Ajax
Note that this is a general list, and support of Ajax applications will depend on the features the browser supports.
  • Microsoft Internet Explorer version 5.0 and above, and browsers based on it (Mac OS versions not supported)
  • Gecko-based browsers like Mozilla, Mozilla Firefox, and Netscape version 7.1 and above
  • Browsers implementing the khtml API version 3.2 and above, including Konqueror version 3.2 and above, and Apple Safari version 1.2 and above
  • Opera browsers version 8.0 and above, including Opera Mobile Browser version 8.0 and above
  • iCab version 3.0b352 and above
Browsers that do not support Ajax
This is a list of browsers that defenitly not support ajax
  • Text-based browsers like Lynx and Links
  • Browsers for blind people (speech-synthesising, braille)
  • Browsers older than 1997
About this Terminology
This terminology is from The Wikipedia which is published under the GNU Free Documentation License.

Saturday, December 22, 2007

Upcoming Changes to the JavaScript Language


After eight years of work in the standards committee, JavaScript will soon get an update. We present the highlights and rationales of the proposed changes to JavaScript.

The fourth edition of the ECMAScript (JavaScript) language represents a significant evolution of the third edition language, which was standardized in 1999. ES4 is compatible with ES3 and adds important facilities for programming in the large (classes, interfaces, namespaces, packages, program units, optional type annotations, and optional static type checking and verification), evolutionary programming and scripting, data structure construction, control abstraction (proper tail calls, iterators, and generators), and introspection. Improved support for regular expressions and Unicode, richer libraries, and proper block scoping are also added.

Wednesday, December 12, 2007

NetBeans 6.0 Integrated Development Environment Ready for Action

Sun Microsystems, Inc. (NASDAQ:JAVA) and the NetBeans community today announced the availability of the award-winning NetBeans(TM) 6.0 Integrated Development Environment (IDE). NetBeans 6.0 IDE extends support beyond Java(TM) by providing a rich set of features for C/C++, JavaScript(TM) and the Ruby language, including Ruby on Rails - further enhancing developer productivity with multiple languages and ease of use.

“The release of 6.0 is the culmination of NetBeans momentum in the IDE marketplace," said Jeet Kaul, vice president of Developer Products and Programs at Sun. “While innovation drives interest and excitement in the developer community, collaboration with and use by key industry players drives adoption. And we are happy to have Ikivo AB, JasperSoft Corporation, Nokia Corporation and Wipro Technologies working with the NetBeans community."

The NetBeans 6.0 release marks a monumental milestone, with the following highlights:

  • Enhanced code editor with smarter code completion, occurrence highlighting, in place renaming and improved navigation and inspection
  • Next generation Swing GUI Builder (formerly known as Project Matisse) with Swing Application Framework and Beans Binding technology
  • Improved visual tools for developing web applications, web services, mobile applications and UML models
  • Extensive edit/refactor/debug test/deploy functionality for Ruby and Ruby on Rails development
  • New file navigation functionality for C/C++ developers with improved debugger integration
  • Comprehensive support for Java Platform Enterprise Edition 5 development

NetBeans 6.0 features previously available from add-on packs such as the Visual Web and Enterprise Packs, have been integrated into NetBeans and are delivered via a single install program. This new install program allows for easy customization and installation. In conjunction with the NetBeans release, Sun Java(TM) Studio Enterprise and Sun Java(TM) Studio Creator have launched migration programs to enable their users to migrate to NetBeans and use the functionality that has been incorporated there.

"As the largest and longest running mobile developer community with more than 3.4 million members, Forum Nokia is continually focused on highlighting best-of-breed productivity tools for our developer community. We are glad to endorse NetBeans 6.0 as a MIDP2 productivity tool that enables developers to bring out the best features of JSR-248 on Nokia devices and thereby addressing several hundred million Nokia device owners," said Lee Epting, vice president, Forum Nokia, Nokia Corporation.

Sun also offers a tiered set of developer support services for its software offerings, ranging from single incident to comprehensive developer plans. In addition, with a broad portfolio of training and certification offerings, developers can enhance their skill sets to take advantage of cutting-edge technologies. To learn more, visit: http://www.netbeans.org/kb/support.html.

The NetBeans Partner Program recognizes the strength that partners bring to the overall NetBeans value proposition as well as the value in reaching one of the largest and pre-eminent communities of software developers in the world.

“We are very excited to engage on a strategic level with Sun and the NetBeans community to help bring advanced rich media content to NetBeans mobility developers specifically and the Java community in general,” said Magnus Zetterberg, vice president of Business Development, Ikivo. “The NetBeans development community can now fully employ the power of Scalable Vector Graphics to facilitate the creation of standards based rich media content on the Java ME platform.”

"As the market leader in open source business intelligence, we recognize the value of the open source NetBeans community," said Jose Morales, vice president of Business Development, JasperSoft. "Our participation with the collaborative NetBeans community is complementary to both NetBeans and JasperSoft technology. By providing iReport as a native NetBeans plugin, developers from the NetBeans community can now enjoy the benefits of developing Java applications with built-in business intelligence."

Wipro Technologies, the leading global provider of integrated business, technology and process solutions on a global delivery platform, has recently joined the NetBeans Strategic Partner Program. "As a global service delivery provider, one of our primary endeavours is to empower our developers to be productive. We see the new NetBeans 6.0 release as a key enabler of increasing our developer productivity. Now as a NetBeans Strategic Partner, we are well positioned to not just leverage the vastly improved and new and innovative features of NetBeans 6.0, but also work with the NetBeans community to contribute and channel our expertise in the developer community as a whole," said Rajesh Ram Mishra, vice president and chief technology officer, Telecom and Product Engineering Solutions, Wipro Technologies.

Developers making the switch to NetBeans

The NetBeans community has experienced tremendous growth, to date there have been more than 16 million downloads and a 300 percent increase in email list subscribers during the past three years. Many developers are migrating to NetBeans from other IDEs. To read about their stories, visit: http://www.netbeans.org/switch/realstories.html

Kaul continues, “Developers are the heart and soul of the IT industry. At Sun we are committed to Free and Open Source software, and it gives me great pleasure to say that NetBeans.org is part of Sun's multi-year sponsorship of a developer program called the Open Source Community Innovation Awards. We believe the program will promote creativity from individuals and teams, and recognize the contributions from some of the brightest minds in the industry.”

Open Source Community Innovation Awards Program

NetBeans community has also been selected as part of Sun’s Open Source Community Innovation Awards Program. Announced last week, the multi-year program is designed to foster innovation and recognize some of the more active open source communities within Sun. Six communities have been selected for the program’s first year: GlassFish(TM), NetBeans, OpenJDK(TM), OpenOffice.org, OpenSolaris(TM) and OpenSPARC(TM). Prizes are expected to total at least $1 million (USD) a year.

Beginning January 2008, the six open source communities will announce the details around the individual programs. Each community will have its own rules and judging criteria. Prize winners will be announced in August 2008. To follow contest updates and major developments, visit: http://www.sun.com/opensource/awards

About Sun Microsystems, Inc.

A singular vision -- "The Network Is The Computer"(TM) -- guides Sun in the development of technologies that power the world's most important markets. Sun's philosophy of sharing innovation and building communities is at the forefront of the next wave of computing: the Participation Age. Sun can be found in more than one-hundred countries and on the Web at sun.com.

Sun, Sun Microsystems, the Sun logo, Solaris, Java, JavaScript, OpenSolaris, NetBeans, GlassFish, OpenJDK and The Network Is The Computer are trademarks or registered trademarks of Sun Microsystems, Inc. in the United States and other countries. All SPARC trademarks are used under license and are trademarks or registered trademarks of SPARC International, Inc. in the United States and other countries. Products bearing SPARC trademarks are based upon an architecture developed by Sun Microsystems, Inc.

Source: PRWeb

Saturday, September 22, 2007

Learn JavaScript From Scratch with SitePoint's "Simply JavaScript"

In 2001 Kevin Yank brought PHP and MySQL into the lives of tens of thousands of developers with his definitive book, Build Your Own Database Driven Website Using PHP & MySQL.

Now, with co-author and JavaScript guru Cameron Adams, Kevin's doing the same for JavaScript with the official release of Simply JavaScript from SitePoint (http://www.sitepoint.com/).

Beautifully presented in full color, Simply JavaScript not only teaches JavaScript with unprecedented clarity, it does so with a sense of humor -- it's guaranteed to keep you entertained.

Perfect for first-time JavaScript coders or individuals looking to improve their programming skills, Kevin and Cameron will guide you through the JavaScript programming basics, as well as provide practical solutions to real-world problems.

Simply JavaScript will teach you how to:

  • Use JavaScript's built-in functions, methods, and properties
  • Change the content of web pages using the DOM.
  • Use JavaScript to respond to user actions.
  • Create animations that bring a web site to life.
  • Build forms that validate entries and interact with users.
  • Build a richer user experience with Ajax.
  • Explore the amazing things that JavaScript makes possible.

The JavaScript code used to create each of the components in the book is available for download, and is guaranteed to be simple, efficient, best practice, and ready to use in your own web site.

Simply JavaScript co-author and SitePoint technical director Kevin Yank is extremely proud of his new book: "We knew from the beginning that it wasn't worth writing another beginner's JavaScript book unless we could produce something really special, and we definitely have."

About SitePoint (http://www.sitepoint.com/)

SitePoint specializes in publishing fun, practical, and easy-to-understand content for web professionals. Its popular online magazine, blogs, newsletters, and print books teach best practices to web developers and designers worldwide.

SitePoint also runs the #1 marketplace on the Web for buying and selling web sites, blogs, and forums.http://www.sitepoint.com/marketplace/

Source: PRWeb

Wednesday, August 8, 2007

Learn jQuery with New Book

A new book on jQuery, the powerful JavaScript library, has been announced today by Packt. In Learning jQuery, Karl Swedberg and Jonathan Chaffer, creators of the popular jQuery learning resource www.LearningjQuery.com, share their knowledge, experience, and enthusiasm about jQuery to help users get the most from the library and to make their web applications shine.

Announced only in January 2006, jQuery is growing steadily into a fast, concise, JavaScript Library that simplifies how users traverse HTML documents, handle events, perform animations, and add Ajax interactions to web pages. jQuery is designed to change the way that JavaScript is written.

jQuery is a powerful JavaScript library that can enhance websites regardless of the developer’s background. For designers, jQuery leverages existing CSS and HTML skills, allowing them to dynamically find and change any aspect of a page. For programmers, jQuery offers an open -source, standards-compliant, unobtrusive approach to writing complex JavaScript applications.

Learning jQuery provides a gentle introduction to jQuery concepts, allowing users to add interactions and animations to pages, even if previous attempts at writing JavaScript have been unsuccessful. The book is designed to guide users past the pitfalls associated with AJAX, events, effects, and advanced JavaScript language features, as well as provide users with a reference to the jQuery library to return to again and again.

The book is written for web designers who want to create interactive elements for their designs, and for developers who want to create the best user interface for their web applications.

Learning jQuery is published by Packt and is out in July 2007. For more information, please visit www.PacktPub.com/jQuery/book

Sunday, February 11, 2007

ActiveState Introduces Komodo Edit 4.0

VANCOUVER, BC — ActiveState Software Inc., the leading provider of development tools and services for dynamic languages, today announced the release of Komodo Edit 4.0, a free editor based on the award-winning Komodo IDE.

Komodo Edit 4.0 delivers powerful editing capabilities for dynamic languages including Perl, PHP, Python, Ruby and Tcl; plus support for browser-side code including JavaScript, CSS, HTML and XML. Background syntax checking and syntax coloring catch errors immediately, while autocomplete and calltips guide developers as they code. It is available now on Linux, Mac OS X, and Windows.

Other features include a project manager, for flexible organization of all project elements, and the Toolbox, for storing configurable "Run" commands, macros, code snippets, URLs, Live and Virtual Folders, templates, menus, toolbars and remote files. Toolbox items can be distributed to other Komodo users.

Komodo Edit 4.0 also allows users to easily extend its architecture, with support for adding advanced capabilities through Firefox-style .xpi extensions.

Also today, ActiveState announced the release of Komodo IDE 4.0, the first unified workspace for end-to-end development of dynamic web applications. A rich feature set for client-side Ajax languages, coupled with advanced support for dynamic languages, enables developers to quickly and easily create robust web apps.

Komodo IDE 4.0 features comprehensive editing and debugging, plus intelligent tools for regular expressions, team development, customization and unparalleled extensibility. The result is a powerful coding environment for framework stacks like Ruby on Rails and CakePHP, and client libraries such as the Yahoo! UI Library and Dojo. A single license covers users across Linux, Mac OS X and Windows. For more information, purchases and free trials, go to http://www.activestate.com/komodo_ide

"Our goal is to create uncompromised, extensible tools built specifically for dynamic language programmers. Our language distributions have always been free, and now Komodo Edit extends that community support into our development tools," said Matt Herdon, Product Manager, Komodo. "This is a world-class, free editor with code intelligence. It's a great introduction to Komodo IDE, a product truly unique in the depth of support for dynamic languages and web application development, but also a powerful tool in its own right."

ActiveState has recently launched the beta release of a community support site, where Komodo users can share code, custom extensions and knowledge. The site currently hosts user forums and FAQs, and will be expanded soon to include resources for creating and sharing extensions.
The site is available now at http://support.activestate.com

About Komodo Edit
ActiveState Komodo Edit 4.0 Beta 5 is available now. For more information or to download the beta, go to http://www.activestate.com/komodo_edit

About ActiveState
ActiveState is the leading provider of tools and services for dynamic languages such as JavaScript, Perl, PHP, Python, Ruby and Tcl. Millions of developers rely on ActiveState's cross-platform, professional development tools, high-quality language distributions, and enterprise services. Learn more at http://www.activestate.com/.


© 2007 ActiveState Software Inc.
All product and company names herein may be trademarks of their respective owners.

ActiveState Announces Komodo IDE

VANCOUVER, BC — ActiveState Software Inc., the leading provider of development tools and services for dynamic languages, today announced the release of Komodo IDE 4.0, a major upgrade to their award-winning development environment. With this release, developers can now create entire web applications—server, browser, and the HTTP conversation that connects them—within a single unified workspace.

Komodo IDE enables developers to write, debug, share and organize quality code in a customizable programming environment. With 4.0, Komodo's support for dynamic languages such as Perl, PHP, Python, Ruby and Tcl, is extended to browser-side languages including JavaScript, CSS, HTML and XML.

New features, including JavaScript debugging, DOM viewer, HTTP Inspector and code intelligence, provide deep support for Ajax techniques, making Komodo IDE essential for developers using dynamic languages and modern web development practices. Support is also extended to framework stacks like Ruby on Rails and CakePHP, and client libraries such as the Yahoo!

UI Library and Dojo, allowing users to remain in the Komodo workspace for the entire development process.

Thousands of users were involved in the beta program, eager to provide feedback on a product many consider indispensable: "We use Komodo IDE to build our internal systems," says Jonathan Eunice, Founder and Principal IT Advisor, Illuminata. "It has saved us an amazing amount of time and effort."

Komodo IDE 4.0 also allows users to easily extend its architecture, with support for adding advanced capabilities through Firefox-style .xpi extensions.

Says Matt Herdon, Product Manager, Komodo, "Above all else, this release is for the community. We are absolutely committed to giving them a world-class IDE designed specifically for their languages—one they can invest in for the long term, with extensions, code and shared know-how.

"Over a year of development and quality assurance effort went into 4.0, not to mention excellent pre-release feedback from users. The web development support has been very much driven by their needs. People want an easy way to build web apps with dynamic languages, and that's what Komodo IDE is all about."

ActiveState has recently launched the beta release of a community support site, which currently hosts Komodo user forums and FAQs and will be expanded soon to include resources for creating and sharing extensions. The site is available now at http://support.activestate.com
Shane Caraveo, Komodo Tech Lead, welcomes the involvement. "Every developer has different needs; different ways of working. With this release, we focused on putting control in the hands of our users.

Komodo's open architecture lets people add a lot of power with just a few lines of code, and we're very excited to see how the community takes advantage of that."

Also today, ActiveState announced the introduction of Komodo Edit, a free multi-language editor. Komodo Edit provides advanced editing capabilities for dynamic languages, including Perl, PHP, Python, Ruby and Tcl, plus support for browser-side code including, JavaScript, CSS, HTML and XML. Komodo Edit, currently in beta, is available at http://www.activestate.com/komodo_edit

About Komodo IDE
ActiveState Komodo IDE 4.0 is available now. A standard license for Linux, Mac OS X and Windows is $245 through February 28, 2007, and $295 thereafter. Discounted upgrade pricing is also available through February 28, 2007. For more information, purchases and free trials, go to http://www.activestate.com/komodo_ide

About ActiveState
ActiveState is the leading provider of tools and services for dynamic languages such as JavaScript, Perl, PHP, Python, Ruby and Tcl. Millions of developers rely on ActiveState's cross-platform, professional development tools, high-quality language distributions, and enterprise services. Learn more at http://www.activestate.com.

© 2007 ActiveState Software Inc.
All product and company names herein may be trademarks of their respective owners.