Thank you for your detailed reply. I'm not sure that I understand all of it.
So I can use cookies to replace global variables? I imagine that the cookie data can be converted back to global variables for the Actions environment but how would I access them in the js file? Could they be accessed as global variables in the js file?
I have been thinking about using cookies for a while because I think I should divide my 2 page book into two separate books and in this case the shared global variables would have to be passed from one to the other. I think two separate books would probably load better. At the moment when the second page loads some objects display as white rectangles until the loading is over.
Another idea I had: instead of using cookies for all the global variables like userName, className, exerciseName etc. most of these could be stored in a file in the user's personal folder on the server. userName would have to be stored in a cookie but all the rest could be in the file and accessed via XMLHttpRequest? Would this work and would it be safer than using cookies only?
I'm a bit disappointed with my progress so far. Over a year and I still haven't finished the first module (creating and using a video exercise). Admittedly it is by far the most complicated bit and I think most of the rest of the program will be easier to convert. It's a bit frustrating because I know it can all be done. My DHTML program is identical to the the VB.NET version and it functions just as well if not better.
Could you take a look at this please? It's a js file version of a TB shared action. I can't get the js file version to work. I've simplified it for testing purposes.
- Code: Select all
function tbfunction_getTextlines(objectInfo) {
var textLines = [];
textLines = tbfunction_pgSplitToArray(objectInfo, crlf, true);
//textLines = tbfunction_pgSplitToArray(objectInfo, "crlf", true);
//textLines = tbfunction_pgSplitToArray(objectInfo, "\r\l", true);
var total = textLines[0];
alert(total);
for (i = 1; i < total + 1; i++) {
alert(i + " " + textLines[i]);
}
};
I just need to create an array containing textlines. This was easier in the Actions system because I could use textline x of test and textlines x to y of text.