This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Changes XML to JSON | |
// Modified version from here: http://davidwalsh.name/convert-xml-json | |
function xmlToJson(xml) { | |
// Create the return object | |
var obj = {}; | |
if (xml.nodeType == 1) { // element | |
// do attributes | |
if (xml.attributes.length > 0) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html xmlns="http://www.w3.org/1999/xhtml"> | |
<head> | |
<title>Status - University of Oxford</title> | |
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"> | |
<style type="text/css"> | |
.status_code_0 {background-color:#039b0b;} | |
.status_code_1 {background-color: #b94a48;} | |
.status_code_2 {background-color: #f89406;} | |
li {padding:0.5em; margin:0.5em; list-style:none; width:20em; font-size:1.3em;} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
document.addEventListener('DOMContentLoaded', init, false) | |
var videoId = document.getElementById('video') | |
//var videoTitle = videoId.getAttribute('data-description') | |
var videoTitle = '宝宝身边有怪物' | |
function init () { | |
videoId.addEventListener('ended', videoEnd, false) | |
videoId.addEventListener('timeupdate', videoTimeUpdate, false) | |
videoId.addEventListener('play', videoPlay, false) |