Skip to content

Instantly share code, notes, and snippets.

@yonicd
Created June 5, 2017 01:02
Show Gist options
  • Save yonicd/2593b31cf92f49a7852013d834531d13 to your computer and use it in GitHub Desktop.
Save yonicd/2593b31cf92f49a7852013d834531d13 to your computer and use it in GitHub Desktop.
testing XMLHttpRequest in windows
library(htmltools)
browsable(
tagList(
tags$pre(id="myPreview"),
tags$script(
'
var uri="https://raw.githubusercontent.com/yonicd/jsTree/master/README.md?raw=true";
loadXMLDoc(uri);
function loadXMLDoc(uri) {
var xmlhttp = new XMLHttpRequest();
xmlhttp.onreadystatechange = function() {
if (this.readyState == 4) {
if(this.status == 200) document.getElementById("myPreview").innerHTML =
this.responseText;
}
};
xmlhttp.open("GET", uri, true);
xmlhttp.send();
}
'
),
rmarkdown::html_dependency_jquery()
)
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment