Ajax error {"readyState":4,"status":404,"statusText":"error"}
Jun 07, 2018
I have a simple storyline slide with one variable on it , and I run this javascript when timeline starts.
Here is my code :
$.ajax({
url: "****",
type: "GET",
success: function (data) {
alert(data);
},
error: function (data) {
alert(JSON.stringify(data));
}
});
The url is correct , I have tested it in the browser. I do publish, with WEB option. This is the error I get : {"readyState":4,"status":404,"statusText":"error"}
The url is a php page with this content:
<?php
echo 'hello';
?>
I attached the html generated file. If someone could provide me with a storyline simple ajax working file, I would be grateful, Thank you!
2 Replies
Topmost, you don't include jquery.js so the global '$' namespace is undefined. Second, the PHP is incorrect; see json_encode documentation on the PHP site. Beyond that, you need to code things so this code gets executed. Fourth, javascript doesn't work everywhere w/Storyline (see Articulate's Best Practices)
jquery is included, otherwise it wouldn't enter in the error function( which is inside the namespace $). I have tried with json_encoded, I have the same error.
This discussion is closed. You can start a new discussion or contact Articulate Support.