So I was goofing around with guideme a bit last night and had some questions, and I'm not quite sure if they are already answered... I tried to search the thread but didn't know the right keywords.
Anyway this may be javascript related or guideme related, am unsure since I haven't really touched javascript much.
Ok first off I was just trying to get the handle on how you write in javascript objects. After googling my thought was to try to write objects sort of like this, and it seemed to be working:
Code: Select all
function Mistress( name )
{
this.name = name;
this.getName = function(){
return this.name;
}
}
var sarah = new Mistress("Sarah");
var allison = new Mistress("Allison");
jscriptLog("set sarah: " +sarah.getName() );
jscriptLog("set allison: " +allison.getName() );
scriptVars.put("sarah", Mistress );
scriptVars.put("allison", Mistress );
I did this in an included file. Then I tried to load it into scriptvars and use it on a page and pull it out, but it seemed to blow up at this point.
Code: Select all
var Sarah = scriptVars.get("sarah");
var Allison = scriptVars.get("allison");
I think it loses the object type or what to do with it. Do I need to cast it as I pull it out of script vars, or can you not define this way and should stick to the singleton type way of doing it the
thing?
Question two was just simply persistence. How to save states of variables or even say dump the contents of scriptvars and persist? Could I google a standard javascript way of opening and writing/reading to a file to persist between sessions, or does guideme have any in built methods for doing that?