Ajax error {"readyState":4,"status":404,"statusText":"error"}

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
Brian Dennis

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)