I'm trying to use this code with Parse.Cloud.beforeSave...
var script = document.createElement('script');
and I get this: Result: ReferenceError: document is not defined
How can I use document with Parse.Cloud?
My code:
function getJSONP(url, success) {
var script = document.createElement('script');
script.src = url.replace('callback=', 'callback=do');
document.head.appendChild(script);
do = function (data) {
success(data);
}
}
evalthe response. JSONP is only used to circumvent the same-origin policy in the browser. There is no need for script tags on the server side, just make the HTTP request.