Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 24 additions & 13 deletions miniYoutube/play.html
Original file line number Diff line number Diff line change
Expand Up @@ -148,10 +148,9 @@
xmlhttp.send();
}

function loadcomment() {
function LoadComments() {
var xmlDoc;
var xmlhttp;
//document.getElementById("views").innerHTML="232";
if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp=new XMLHttpRequest();
}
Expand All @@ -161,21 +160,34 @@

xmlhttp.onreadystatechange=function() {
if (xmlhttp.readyState==4 && xmlhttp.status==200) {
xmlDoc = xmlhttp.responseText;



}
xmlDoc = xmlhttp.responseXML;
var i;
var con = xmlDoc.getElementsByTagName("contents");
var nam = xmlDoc.getElementsByTagName("name");
var tim = xmlDoc.getElementsByTagName("time");
for(i=0;i<con.length;i++)
{
if(i==0)
{
document.getElementById("ShowCom").innerHTML = "<p class='text-info'>"+nam[i].childNodes[0].nodeValue+"&nbsp"+tim[i].childNodes[0].nodeValue+"</p>";
document.getElementById("ShowCom").innerHTML += "<p>"+con[i].childNodes[0].nodeValue+"</p>";
}
else {
document.getElementById("ShowCom").innerHTML += "<p class='text-info'>"+nam[i].childNodes[0].nodeValue+"&nbsp"+tim[i].childNodes[0].nodeValue+"</p>";
document.getElementById("ShowCom").innerHTML += "<p>"+con[i].childNodes[0].nodeValue+"</p>";
}
}
}
}

xmlhttp.open("GET","./lib/jsp/loadComment.jsp?vid="+vid,true);
xmlhttp.open("GET","./lib/jsp/loadComment.jsp?vid="+vid,false);
//xmlhttp.setRequestHeader('Content-Type', 'text/xml');
xmlhttp.send();
}

$(document).ready(function(){
window.onload=checkSession();
window.onload=loadvideo();
window.onload=loadcomment();
window.onload=LoadComments();

});

Expand Down Expand Up @@ -265,8 +277,7 @@ <h4 class="modal-title" id="myModalLabel">Do you want to report this video?</h4>
<div class="col-md-8 column">

<h3 class="text-info">Comments</h3>
<div id="disqus_thread"></div>
<!-- Input timestamp form -->
<div id="ShowCom"></div>
<form>
<input type="checkbox" id="timed" value="timed">Timed<br>

Expand Down Expand Up @@ -350,4 +361,4 @@ <h3 class="text-info">Comments</h3>
</div>
</div>
</footer>
</html>
</html>