Created
June 5, 2017 01:02
-
-
Save yonicd/2593b31cf92f49a7852013d834531d13 to your computer and use it in GitHub Desktop.
testing XMLHttpRequest in windows
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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