Insert a local web object that needs to load a Javascript file

Mar 15, 2019

Hello,

I am trying to insert a local web object in my project but there is something I don't know how to solve. The web-based application that I want to insert loads just fine. But the initial screen is a configuration setup and, after doing it, it saves a .js file (Javascript) with all the information related with such configuration. In order to properly load localy the application with this configuration is typing in the browser:

file:///path/to/index.html?path/to/configuration.js

When I include the web object in Storyline, it is possible to do it until the "index.html", but I don't know how to point to the configuration file as it says that it is not a valid address. 

How could I achieve this?

Thank you.

5 Replies
Pedro Martinez

Thank you for your answer Michael. No, I don't want the user to perform any configuration. On the contrary, I want the application to automatically load the configuration file that I've created beforehand. If I run the application locally and I put in the browser something like this:

file:///path/to/index.html

It loads the application and asks for the initial setup that I mentioned before. After this configuration has been done, it is saved in a .js file, and in order to load it in the browser, I can do it with the:

file:///path/to/index.html?path/to/configuration.js

I have no problem loading the first line of code that opens the initial screen of the application. But as I want the user to access to the second step, I don't know how to indicate storyline to load the application loading the .js file.

I hope I have explained it better this time.

 

Russell Killips

Perhaps you can create a redirect index.html page.

The Stoyline WebObject will point to the redirect index page. Then the redirect takes you to the app.

The code inside the redirect index page could be something like:

<!DOCTYPE html>
<html>
<head>
<title>Redirect</title>
</head>
<body>
<script>
var url = "app.html?configuration.js";
window.location = url;
</script>
</body>
</html>

Pedro Martinez

That's exactly what I needed! It worked wonderfully. Thank you so much.

The only inconvenience now is that there are several references in the index.html and the configuration.js files that, after publishing, need to be edited manually because within the folder, it doesn't have the same structure and it puts the files in folders with different names (random numbers and letters). But after modifying the data, it works. I guess I will need to adjust all of that manually but I am happy I know how to make it work.

Thank you!

This discussion is closed. You can start a new discussion or contact Articulate Support.