Category Archives: AJAX

xmlObjectifier – interesting library for converting XML or SOAP to JSON

Looking for a simple way to convert XML to JSON Object?

xmlObjectifier is designed to assist coders working with XML data to quickly and painlessly process XML documents using familiar to JavaScript developpers methods. This useful code will provide  transparent obstraction layer to those applications that utilize both JSON and XML data, it also allows you to cache your data for later use. xmlObjectifier is written in client-side JavaScript to reduce processing overhead and to provide optimal compatibility across various browsers.

via.

Cross-domain Ajax requests – Sencha Touch Bits

Cross-domain Ajax requests

MARCH 11, 2011

Before you get any hopes (or worries), the following is just a technique that comes handy for development, not for production.

I’m developing a PhoneGap app with Sencha Touch. The app needs to do a few Ajax POST requests to a different domain. You can do that without problems from your PhoneGap app.

Though, the development environment of choice for a Sencha Touch developer is the browser. Browsers don’t let you do that, at least not by default. (You can do cross-domain GET requests easily via JSONP.)

By default, the browser, WebKit in this case, returns the following error: XMLHttpRequest cannot load URL. Origin http://localhost is not allowed by Access-Control-Allow-Origin.

Though, you can easily disable that security policy by opening the browser with –disable-web-security.

So, if you’re using Google Chrome on a Mac for development, run the following in the Terminal:

open /Applications/Google Chrome.app –args –disable-web-security

via Cross-domain Ajax requests – Sencha Touch Bits.

YUI 3 — Yahoo! User Interface Library

YUI 3 — Yahoo! User Interface Library

YUI 3 is Yahoo!’s next-generation JavaScript and CSS library. It powers the new Yahoo! homepage, Yahoo! Mail, and many other Yahoo! sites. The YUI 3 Library has been redesigned and rewritten from the ground up incorporating what we’ve learned in five years of dedicated library development. The library includes the core components, a full suite of utilities, the Widget Infrastructure, a growing collection of widgets, CSS resources, and tools. All YUI components are BSD-licensed and are available for forking and contribution on GitHub. In addition to the core components included in the YUI 3 Library, there is also a gallery of components created by developers in the YUI community that provide additional functionality leveraging YUI 3 that can be used in the development of robust web applications.

via YUI 3 — Yahoo! User Interface Library.

Raymond Camden’s ColdFusion Blog: Using argumentCollection with AJAX calls to ColdFusion Components

If you pass argumentCollection=data to a CFC method (or any UDF), then ColdFusion acts as if you had passed arguments name, age, and coolness. As I said above, this isn’t new at all, but I’ve never seen it used with an AJAX post like this. What’s nice then is that on the server side, you can have a “proper” method without any if/else statement to see if the result was JSON. As a quick example, here is an updated version of the front end code based on the previous example. I went ahead and added jquery-json to the template to further simplify things.

via Raymond Camden’s ColdFusion Blog: Using argumentCollection with AJAX calls to ColdFusion Components.

Awesome tip and as usual a complete and yet concise example of how to use it.