14.07.2013 Views

Basic web security model - Stanford Crypto Group

Basic web security model - Stanford Crypto Group

Basic web security model - Stanford Crypto Group

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Same Origin Requests with<br />

XMLHttpRequest<br />

<br />

var xhr = new XMLHttpRequest();<br />

xhr.open("POST", "http://www.example.com:81/foo/<br />

example.cgi", true); // asynchronous<br />

xhr.send("Hello world!");<br />

xhr.onload = function() {<br />

if (xhr.status == 200) {<br />

alert(xhr.responseText);<br />

}}<br />

<br />

read response<br />

prepare request

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!