Browsing projects by Tag(s)

Select a tag to browse associated projects and drill deeper into the tag cloud.

Showing page 1 of 1

Sarissa is an ECMAScript library acting as a cross-browser wrapper for native XML APIs. It offers various XML related goodies like Document instantiation, XML loading from URLs or strings, XSLT transformations, XPath queries etc and comes especially handy for people doing what is lately known as "AJAX" development.

0
 
  0 reviews  |  3 users  |  4,060 lines of code  |  1 current contributor  |  Analyzed 5 days ago
 
 

Emle - Electronic Mathematics Laboratory Equipment has the mathematics equivalent of physical science lab equipment. HTML, XML, Javascript, XSLT. Works in Firefox.

0
 
  0 reviews  |  0 users  |  7,025 lines of code  |  0 current contributors  |  Analyzed about 2 hours ago
 
 

DescriptionAsyncXMLHttpRequest is an extension of XMLHttpRequest with the following improvements: Uniform behavior on multiple different browsers (Apple Safari, Google Chrome, Microsoft Internet Explorer, Mozilla Firefox and Opera). Event handlers are called with the AsyncXMLHttpRequest object to ... [More] which they apply as the first argument. This makes it easy to have multiple parallel requests because there is no need to find out for which object an event has fired. A timeout attribute can be set to a number of milliseconds , the request is aborted if it didn't complete within the given number of milliseconds after calling send(). A timedout attribute has been added that is false as long as the request has not been aborted because of a time out and true when it has. Arguments passed to the open() and send() methods are saved in attributes of the object for later reference. These attributes are: method, url, user and password for open() and body for send(). Three additional events have been added: onload, onerror and ontimeout. These are called when the readyState has changed to 4 and the request has, respectively, succeeded (no timeout, status == 2xx), failed (no timeout, status != 2xx) or has timed out. Cross Browser Uniform BehaviorTo make AsyncXMLHttpRequest work uniformly across different browsers, it catches and handles some exceptions that are throw in some browsers, but not in others. Specifically, Firefox, MSIE and Opera throw exceptions when calling the open() and send() methods for certain invalid or cross-origin urls. If any of these exceptions are caught and handled, the request will fail similar to other browser by having status == 0 after the readyState has changed to 4. Parallel concurrent RequestsTo allow any number of parallel requests to take place and still keep track of which request is in what state, all event handlers are passed the AsyncXMLHttpRequest object to which they apply. In other words, when a certain AsyncXMLHttpRequest object is done (readyState == 4), the onreadystatechange event handler is called with the AsyncXMLHttpRequest object to which it applies as the first argument of the call. ExampleThis example shows that you can create any number of parallel requests (the browser or OS may have a built in limit) without having to keep track of which object an event is firing for because it is passes as an argument to the event handler: function go() { for (var i = 0; i < 30; i++) { request(location + "?" + i); } } function request(url) { span = document.createElement("DIV"); document.body.appendChild(span); span.innerHTML = "" + url + ""; xmlhttp = new AsyncXMLHttpRequest(); xmlhttp.span = span; xmlhttp.onload = load; xmlhttp.onerror = error; xmlhttp.ontimeout = timeout; xmlhttp.timeout = 1000; xmlhttp.onreadystatechange = rs; xmlhttp.open("GET", url); xmlhttp.send(); } function rs(xmlhttp) { xmlhttp.span.innerHTML += " rs:" + xmlhttp.readyState; } function load(xmlhttp) { xmlhttp.span.innerHTML += " load:" + xmlhttp.status; } function error(xmlhttp) { xmlhttp.span.innerHTML += " error:" + xmlhttp.status; } function timeout(xmlhttp) { xmlhttp.span.innerHTML += " timeout:" + xmlhttp.status; } [Less]

0
 
  0 reviews  |  0 users  |  256 lines of code  |  0 current contributors  |  Analyzed 7 days ago
 
 
 
 

Creative Commons License Copyright © 2013 Black Duck Software, Inc. and its contributors, Some Rights Reserved. Unless otherwise marked, this work is licensed under a Creative Commons Attribution 3.0 Unported License . Ohloh ® and the Ohloh logo are trademarks of Black Duck Software, Inc. in the United States and/or other jurisdictions. All other trademarks are the property of their respective holders.