Skip to content

Instantly share code, notes, and snippets.

View vinayakhumberi's full-sized avatar
:octocat:

Vinayak Humberi vinayakhumberi

:octocat:
View GitHub Profile
@vinayakhumberi
vinayakhumberi / XMLHttpRequest.js
Created March 11, 2020 15:01 — forked from CharlyJazz/XMLHttpRequest.js
XMLHttpRequest injection load javascript script.
//Before </body> tag
<script>
var xhr = new XMLHttpRequest();
xhr.open("get", "cookbook.js", true);
xhr.onreadystatechange = function () {
if (xhr.readyState == 4) {
if (xhr.status >= 200 && xhr.status < 300 || xhr.status == 304) {
var script = document.createElement("script");
script.type = "text/javascript";
script.text = xhr.responseText;