DocumentUp
DocumentUp copied to clipboard
jQuery example doesn't work
$.ajax({
url: "https://documentup.com/compiled",
dataType: "jsonp",
data: {
content: "# test",
name: "Test JSONP!"
},
success: function(resp){
// `status` is always provided
if (resp.status == 200) {
// Write to your document
document.open();
document.write(resp.html);
document.close();
}
}
});
This actually generates a 404, for some odd reason. Not sure why, as this is a documented API in the README.
This was actually discovered when I was trying to replace this example with something that uses the native fetch.
Huh, good catch.
This is deprecated. Should remove from the docs.
Deprecated? Fancy an MR that takes it out, then?
Either that or we re-implement it :) I think it's maybe a helpful feature, but not in that form exactly.
Haha, I'd love to modernise some of this with fetch and the new cool JS APIs :D