25
js/model.js
25
js/model.js
@@ -19,4 +19,29 @@ class Model {
|
||||
|
||||
return this.comments;
|
||||
}
|
||||
|
||||
getVideoFileName(xml) {
|
||||
let parser = new DOMParser();
|
||||
let xmlDoc = parser.parseFromString(xml, "text/xml");
|
||||
let videoTag = xmlDoc.activeElement.getAttribute("src");
|
||||
|
||||
return videoTag;
|
||||
}
|
||||
|
||||
getCommentsObjects() {}
|
||||
|
||||
async loadXml(v) {
|
||||
var Connect = new XMLHttpRequest();
|
||||
// Define which file to open and
|
||||
// send the request.
|
||||
Connect.open("GET", "./videos/" + v + ".xml", false);
|
||||
Connect.setRequestHeader("Content-Type", "text/xml");
|
||||
Connect.send(null);
|
||||
// Place the response in an XML document.
|
||||
var TheDocument = Connect.responseText;
|
||||
// Place the root node in an element.
|
||||
// var Customers = TheDocument.childNodes[0];
|
||||
|
||||
return TheDocument;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user