Below Code display Video Cam feed on your page… navigator.getUserMedia = navigator.getUserMedia || navigator.webkitGetUserMedia || navigator.mozGetUserMedia; if (navigator.getUserMedia) { navigator.getUserMedia({ audio: true, video: { width: 1280, height: 720 } }, function(stream) { var video = document.querySelector(‘video’); video.srcObject = stream; video.onloadedmetadata = function(e) { video.play(); }; }, function(err) { console.log(“The following error occurred: ” + err.name); […]

Read More →

Code to check whether given string is a Palindrom or not function palindrome(str) { // Good luck! var revers = str.split(“”).reverse().join(“”).toLowerCase().replace(/\W/g, ”).replace(“_”,””); var actualStr =str.toLowerCase().replace(/\W/g, ”).replace(“_”,””); console.log(revers +” : “+actualStr); if(revers === actualStr) {return true;} return false; }

Read More →

  function createRequestObject() { var tmpXmlHttpObject; //depending on what the browser supports, use the right way to create the XMLHttpRequest object if (window.XMLHttpRequest) { // Mozilla, Safari would use this method … tmpXmlHttpObject = new XMLHttpRequest(); } else if (window.ActiveXObject) { // IE would use this method … tmpXmlHttpObject = new ActiveXObject(“Microsoft.XMLHTTP”); } return tmpXmlHttpObject; […]

Read More →