19 April 2014

The Ruby Reflector

Topic

XMLHttpRequest

  Source Favicon
Email

XMLHttpRequest

It's also possible to send requests via JavaScript. There is nothing special about these request from a mechanical perspective. They're just requests like the ones we've sent above.

Because these requests are sent with JavaScript, in order to see what happens we'll have to provide a function that deals with the response. We'll use a simple function that will write whatever response we get to the JavaScript console. function callback () { console.log(this.responseText); …

robots.thoughtbot.com Read
  Source Favicon
On igvita.com 5 months ago.
Email

…of the WebSocket handshake. Further, unlike a regular HTTP request (e.g. XMLHttpRequest initiated by the browser), WebSocket also allows us to negotiate compression parameters in both directions (client-to-server and server-to-client). That said, let's start with the simplest possible case:

GET /socket HTTP / 1.1 Host : thirdparty.com Origin : http://example.com Connection : Upgrade Upgrade : websocket Sec-WebSocket-Version : 13 Sec-WebSocket-Key : dGhlIHNhbXBsZSBub25jZQ== Sec-WebSocket-Extensions …

igvita.com Read
  Source Favicon
By Assaf of Labnotes almost 2 years ago.
Email

Brandon Rhodes :

Kids will ask "What did the XML in XMLHttpRequest stand for?" and we'll answer "Just read it as a censored ‘ FML'—long story."

1. WSDL 2. Hilary ensues :

"We have an employee whose last name is Null. He kills our employee lookup app when his last name is used as the search term (which happens to be quite often now)."

blog.labnotes.org Read
  Source Favicon
By fxn of Riding Rails - home almost 3 years ago.
Email

…helper is a simple convenience method that sets the X REQUESTED WITH header to " XMLHttpRequest". If the test request has no Accept header, a fixed value of [Mime::JS, Mime::HTML, Mime::XML, 'text/xml', Mime::ALL].join(', ')

serves as default.

The Accept header in Prototype calls corresponds to that value, but in jQuery it depends on the dataType attribute. Also, in other JavaScript libraries the Accept header may behave differently. What to do with …

weblog.rubyonrails.org Read
  Source Favicon
Email

…they're not impossible to capture if we're willing to use implementation details such as XMLHttpRequest as a proxy for those factors, then tie that implementation to our user experience intent using language in our Cucumber steps: Then the comment on "Ford" should have been posted quickly, without reloading the page, and with brief visual feedback

"without reloading the page" would be implemented using our AjaxReloader , "posted quickly" could be …

robots.thoughtbot.com Read
  Source Favicon
By Max of occasionally useful over 3 years ago.
Email

…industry, showed us all two things: 1) Javascript can be used to be, well, useful, and 2) XmlHTTPRequest is incredibly useful (and iframes, bleh). This begins the trend of taking web applications seriously as a replacement for certain desktop applications.

Fast forward a few years -- there are now many many Web 2.0 apps and/or RIA apps. So many, in fact, that there is a veritable glut of apps. We have a new discoverability problem, but not because we can't find the apps we need, …

blog.maxaller.name Read
  Source Favicon
By makoto of Bamboo Blog almost 4 years ago.
Email

…Sec-| cannot be set by an attacker from a Web browser, even when using | XMLHttpRequest|.

NOTE: I am not sure why Sec- cannot be set from a Web browser (unless Sec- is a reserved word for HTTP protocol). If you know any info, please comment.

#3 and #4 are used for opening handshake and I will explain in next section.

From Server to Client

Old HTTP/1.1 101 Web Socket Protocol Handshake Upgrade: WebSocket Connection: Upgrade WebSocket-Origin: http://example.com WebSocket-Location: …

blog.new-bamboo.co.uk Read
  Source Favicon
By Simone Carletti of Simone Carletti's Blog almost 4 years ago.
Email

has not finished loading. :success : Called when the XMLHttpRequest is completed, and the HTTP status code is in

the 2XX range. :failure : Called when the XMLHttpRequest is completed, and the HTTP status code is

not in the 2XX range. :complete : Called when the XMLHttpRequest is complete (fires after success/failure if

they are present).

You can further refine :success and :failure by adding additional callbacks for specific status codes.

Example: # Generates: <a href="#" …

simonecarletti.com Read
  Source Favicon
By John Resig of John Resig over 4 years ago.
Email

var xhr = window. XMLHttpRequest ?

new XMLHttpRequest ( ) :

new ActiveXObject ( " Microsoft.XMLHTTP" ) ;

xhr. open ( " GET" , "test.xml" , false ) ;

xhr. send ( null ) ;

var xml = xhr. responseXML ;

XML

Test the elements in the XML document directly (should be case sensitive).

runTest ( " XML" , function ( ) {

return xml. documentElement . childNodes ;

} ) ;

XML createElement

Same as the HTML

ejohn.org Read
  Source Favicon
By John Resig of John Resig over 4 years ago.
Email

Digging in to the execution of an XMLHttpRequest on a page we get to see some of the full execution stack trace - and this is where the tools starts to become really interesting. The tool is capable of tracing across JavaScript, through the native XMLHttpRequest, through the network request, and back to the handler that fires when the request is done. This is phenomenal. This is the first tool that I've seen that's capable of tracing through native methods to give you a picture of …

ejohn.org Read