Web Info & Tutorials

August 1st, 2008

ANOTHER JAXER 1.0 RELEASE CANDIDATE WITH NEW APIS

Greg philologue has blogged most a newborn promulgation politician for Aptana Jaxer that contains a aggregation of newborn features.

Kevin Hakman told us most the release:

We’ve had server-side JS database APIs every along, but today handing termination sets is modify easier. There’s also today flooded dustlike foodstuff curb and admittance to the whole act wheel with APIs for communication headers, redirects, noesis and types. Speaking of types… for the prototypal instance with Jaxer, you crapper convey noesis types another than HTML including JSON, XML, GIF, etc… Yes, modify GIFs. Jaxer has a firm newborn Image API that among another things crapper modify Canvas to noise images and help them up. Like, Greg, I likewise rattling aforementioned the intent of using Jaxer for easily creating JSON accumulation services which is a apace ontogeny way as developers conceive the coercive capabilities of JSON more and more. In Jaxer, it’s rattling modify since it’s every autochthonous JavaScript on the client, on the wire, and on the server. There’s modify enhanced JSON publishing to attain it modify easier than before on both computer and server. JSON services also unstoppered Jaxer to be multipurpose in compounding with flush internet clients another than Ajax UIs much as Flash, Flex or modify Silverlight since every those hold JavaScript on the computer and crapper spend JSON data. For Ajax and RIA developers this is a boon since you crapper today indite your client-side and server-side cipher in the aforementioned language. And if you favour XML accumulation services Jaxer’s autochthonous E4X (ECMAScript for XML) hold effectuation you crapper appendage XML docs natively in JS on Jaxer as well.

This promulgation also includes a totally newborn concept: a bonded toy which as Greg explains, “lets you load, on the server, pages from another domains and earmark their JavaScript to fulfil without gift them admittance to the Jaxer API or your possess server-side code, but ease gives your cipher admittance to their pane objects and anything exclusive them”. For anyone who has ever finished screenscaping for mashups or another applications, this rattling helps a aggregation since Ajax pages hit historically thwarted bowing operations. With this feature in Jaxer you crapper securely intend a far page, fulfil its functions, and bowing the resulting DOM nodes (yes, you requirement not do windy manipulations with strings) and voila!

Here are the features:

  • Application environment settings that allowing for easier app configuration, app properties, database settings, etc…
  • Database API enhancements with richer APIs for employed with termination sets.
  • Server-side ikon touching including server-side sheet hold and knowledge to modify to another ikon types.
  • Native bidding enforcement API so that you crapper separate grouping commands and appendage the production from those.
  • Asynchronous server-side JavaScript processing lets you compel callbacks in your server-side cipher too.
  • Ability to convey bespoken noesis types (e.g. json, xml, gif, html, etc…)
  • Full curb of the request/response lifecycle including environment redirects, headers, content, etc…
  • Secure toy activity interbreed field calls, sandboxed JavaScript execution, META refreshes, …
  • Serialization hold for JavaScript objects to and from XML, E4X and JSON.

Uri Sarid has a enthusiastic place that shows how you crapper do DOM Scraping with Jaxer, and updates it for this stylish release:

There’s a aggregation of another newborn morality in Jaxer 1.0, as substantially as the authorised free edition of the Mozilla engine institute in Firefox 3. So for warning getElementsByClassName is natively implemented (see John Resig’s pace comparison), in constituent to the another Mozilla features much as built-in XPath functionality and a rattling burly DOM feature set — meet what you requirement for whatever earnest ’screen scraping’, mashups, and noesis repurposing.

Let’s wager it in action!

It includes cipher that shows the Sandbox in action, as substantially as the DOM work:

JAVASCRIPT:

  1.  
  2. // Gets a separate of the far page’s HTML, after whatever cleanup 
  3. function getFragment(title, url, isClassName, identifier, classesToRemove) 
  4. { 
  5.     var toy = new Jaxer.Sandbox(url)
  6.     var table = sandbox.document[isClassName ? ‘getElementsByClassName’ : ‘getElementById’](identifier)
  7.     var container = addToPage(title, contents)
  8.     if (classesToRemove) 
  9.     { 
  10.         if (typeof classesToRemove == “string”) classesToRemove = [classesToRemove]
  11.         classesToRemove.forEach(function(className) 
  12.         { 
  13.             removeNodeList(container.getElementsByClassName(className))
  14.         })
  15.     } 
  16.     return container.innerHTML
  17. } 
  18. getFragment.proxy = true
  19.  
August 1st, 2008

OPEN WEB 0.4: COMPOSABILITY, INTEROP, UBIQUITY, AND THE CLIENT

Brad Neuberg got a Brobdingnagian turn of feedback on his call for a definition of the Open Web. He distilled that aggregation and proven hornlike to become up with something that fits into digit sentence, and ended up with this:

The Open Web is an interoperable, ubiquitous, and searchable meshwork where everyone crapper deal information, integrate, and pioneer without having to communicate for permission, reachable finished a coercive and coupler client.

His litmus effort for this asks if the profession in discourse has:

  • Composability The knowledge to innovate, link, contribute, search, and combine without flushed tape, emotion of a lawsuit, or having to communicate “please?”
  • Interoperability The knowledge for developers to interoperate without having to undergo of apiece others existence
  • Ubiquity The presence of a ordered of unstoppered technologies and services united upon by the widest doable community
  • Universal Client Empowering and evolving the application and scheme technologies as a coupler client
August 1st, 2008

CROSS DOMAIN ACCESS NOW, AND SUPPORT FOR THE FUTURE

Kris Zyp is rattling directive the calculate on different missions much as JSON-* and XHR-*. This instance he has a bill on a newborn cross-site XHR plugin repository that wraps up the myriad of techniques that are both pending in standards (XDomain, XHR++) and impact arounds (window.name, illusion iframe hackery). It also water backwards to the truehearted “just place up a proxy” for those slummy browsers that can’t appendage the ninja.

JAVASCRIPT:

  1.  
  2. // Access-Control: earmark <*> for XHR
  3. dojox.io.xhrPlugins.addCrossSiteXhr(“http://othersite.com/”);
  4. dojo.xhrGet({url:“http://othersite.com/data”})
  5.  
  6. // window.name
  7. dojo.require(“dojox.io.xhrWindowNamePlugin”);
  8. dojox.io.xhrWindowNamePlugin(“http://othersite.com/”);
  9.  
  10. // agent for the another folk
  11. dojox.io.xhrPlugins.addProxy(“/proxy?url=”);
  12.  

Fantastic impact as usual.