Hello, I am not getting AJAX to work. I use this script-structure within my playcanvas-JS:
- converted to:
autoGenTextSquares.prototype.doautoGenTextSquares = function (screenPosition) {
var from = this.cameraEntity.getPosition ();
var to = this.cameraEntity.camera.screenToWorld(screenPosition.x, screenPosition.y, this.cameraEntity.camera.farClip);
var result = this.app.systems.rigidbody.raycastFirst(from, to);
if (result) {
var hitEntity = result.entity; this.firstPosition =hitEntity.getLocalPosition();
if (hitEntity.name === 'Start_RecDial1'){
$.ajax({
type: "GET",
url: " ... (meta-cloaked) ... /insertChk.php"
}).done(function( data) {
console.log("req done");
alert( "Request is done" );
});
}
});
And within my exported index.html I write the AJAX reference:
.....
<body>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js" type="text/javascript"></script>
<script src="__start__.js"></script>
<script src="__loading__.js"></script>
</body>
</html>
The page reacts with console and alert, but it doesn’t write to my DB (insertChk.php that already works seprately)
NB: This post is also written within Call external HTML page … ,… states my urgency.