Skip to content

Instantly share code, notes, and snippets.

@bkreda
Created September 20, 2011 09:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bkreda/1228745 to your computer and use it in GitHub Desktop.
Save bkreda/1228745 to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
</head>
<body>
<div>
<video class="my-video" poster="/widgets/my-video-poster.png" controls="controls">
<source src="avc1_480x268.mp4" type="video/mp4; codecs='avc1.42E01E, mp4a.40.2'"></source>
<source src="h263_176x144.3gp" type="video/3gp; codec='h263, mp4a'"></source>
</video>
</div>
</body>
</html>
<html>
<head>
<script type="text/javascript">
function callXHR(){
console.log("Inside");
var xhr = new XMLHttpRequest();
var strURL = "http://localhost/chunk.xml";
xhr.open('GET', strURL, true);
xhr.onreadystatechange = function() {
if (xhr.readyState == 4) {
if (xhr.responseXML) {
console.log("Happy " + xhr.responseXML);
document.getElementById('x').innerHTML = xhr.responseText;
}
}
}
xhr.setRequestHeader("Content-Type", "application/xml");
xhr.send();
}
</script>
</head>
<body>
Hello world
<div id="x">
</div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment