Easy Function For GetElementById

        function $(id){ return document.getElementById(id); }

Make Canvas Listen for key event

        function $(id){ return document.getElementById(id); }
       
        $('canvas').setAttribute('tabindex','10');
        $('canvas').focus();

Make Div Full With Screen

For <div class=”App”></div>:

.App {
  text-align: center;
  border: 1px solid #F00;
  height: 100vh;
  width: 100vw;
}

Create URL For Uploaded File

function getObjectURL(file) {
  var url = null ;
  if (window.createObjectURL !== undefined) { // basic
      url = window.createObjectURL(file) ;
  } else if (window.URL !== undefined) { // mozilla(firefox)
      url = window.URL.createObjectURL(file) ;
  } else if (window.webkitURL !== undefined) { // webkit or chrome
      url = window.webkitURL.createObjectURL(file) ;
  }
  return url ;
}
Categories: Web

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Inline Feedbacks
View all comments

XML To JSON
: Input your strings, the tool can convert XML to JSON for you.

X
0
Would love your thoughts, please comment.x
()
x