Friday, December 20, 2019

the only other thing i could do is write some actual functions and do some error handling, but that's exactly what i don't want to do.

i should be able to just load the object, and determine if it exists or not, without having to write a fucking book about it.
so, what i'll need to do when i get back is ask: how do i run a local, hardcoded script automatically when the page loads?

can i put it in the header, even?
to be clear about the javascript frontend....

when i sat down to do this, the rule was that it had to be self-contained. so, i didn't want to have any *.js files - i wanted everything to be hardcoded into the html. i also didn't want to call any external routines or force the user to have to go online to connect to any websites. i don't want to use any servers at all. this should work when the user is disconnected from the internet altogether. so these are the parameters i'm working with, and i'm not interested in trying to work around them. i didn't even want to use javascript at all, but it's easy enough for the basic script...

i'm able to get all the information i need from the built-in commands, but i can't get the object to load without explicit user input. or, at least, i can't find the right listener. so, the script knows where the file is. it knows how to load it. but, it won't actually load it unless the user clicks something.

what i want the script to do, though, is figure out which file the player needs to load when the user clicks. so, the script has to do something before i get any user input. and, none of the listeners i've tried up to this point want to let me do that - they all get the right pointers in place, and then wait for the user to click.

so, is this possible? well, security risks aside, it's a pretty basic level of functionality. i'm used to programming with an actual compiler; i have minimal experience scripting anything at all. but, if javascript can't do something this simple without calling a bunch of libraries, it's kind of useless, isn't it?

if i conclude, after trying a few more things, that i can't do what i want, then i'll have to prompt the user to tell me what file type they bought. and, you can blame the awkwardness of it on the language.
i actually think it's time we put the (doubting) t'mas back in christmas.

we don't need another odin post this year. there's too many, already.

i got paid today, but i'm still sick and i'm probably not doing anything this year at all except catching up on the work i've been putting off for too long.

as of today, the oiprd is predictably late on their response to the appeal. i have sent them an email and will call the divisional court on monday to follow up.

for today, i actually need to get some groceries. and, i could be inside for the bulk of the next month...
this is actually kind of tricky.

i know what i need to do, but it just won't load the file. it knows the path. i'm telling it to load. it won't do it...

it's because i'm trying to force it do it on pageload. if i was reacting to any kind of user input at all, it would be easy.

so, i could set it up so that the user tells me what file they're using, but i don't actually want to do that. i want the javascript to be able to figure it out.

so, i think it's best if i try to take a nap and come at it fresh in the morning.

the smoke down here this evening has been horrific.
on second thought, i had tricked myself with a boolean with that. that object isn't reading that variable at all; my testing was built around a false positive.

as mentioned previously, i'm not interested in doing error handling or writing a complicated script. i want this to be very, very simple and clean, so i need to find the right bit.

if i could get it to read the type attribute, but it doesn't want do that, either.

i'm sure there's an easy answer. i need to figure that out by the end of the night.