So I have a PHP file on my server which handles callbacks from external sites. There is no HTML/CSS files, just the PHP file.
Now I have to run some javaScript Code inside the PHP file but the javaScript Code is dependent on an external js file which I have access to both by file and url.
How can I link this external file to my PHP so I can use it. I've tried a lot of things but none of those seem to work.
For simplicity here's the dummy code:
<?php
echo '<script type="text/javascript">
Parse.initialize("ID1", "ID2");");
var TestObject = Parse.Object.extend("Class");
var testObject = new TestObject();
testObject.save({Text: "Hi"}, {
success: function(object) {
alert("done");
},
error: function(model, error) {
alert("error");
}
});
</script>';
?>
And it's dependent on parse.js which I have in my rootfolder and also can be accessed via http://www.parsecdn.com/js/parse-1.4.2.min.js