This is an automated archive made by the Lemmit Bot.

The original was posted on /r/perchance by /u/pentopia11 on 2023-06-28 18:29:24+00:00.


Hello!

I’m working on a generator similar in function to this one here: https://perchance.org/zxkplkzcd0

I just stripped out most of the non-relevant parts so that it would be easier to see what’s going on, plus the content of the original is a bit much so it would feel a bit weird asking for help on that directly lol.

Basically: the generator seems to work just fine in Chrome-based browsers and Firefox, but it’s completely unable to execute JS code in Safari-based browsers. I’ve two main implementations. The first is where it generates the list of outputs inside the JS function, and when pressing randomize in Safari, the generator gives the following error:

An error has occured somewhere in your code (in lists or HTML): There was an error in the onclick attribute of this element in your HTML panel: <button>randomize!</button>. Here's the error: ReferenceError: Can't find variable: items

The other implementation creates the list when randomize is clicked and passes the list into the function. You should be able to test that one too by just swapping which temp is commented out, though this one doesn’t give any errors on Safari, so I left the other one in as default since it fails more obviously.

The Javascript portion of it handles creating the HTML to link the items. I would prefer not to sacrifice this portion of the functionality just because Safari can’t handle it. I have a workaround in place in my actual generator, so it’s not the worst thing in the world, but I’m interested to see if there’s a more feasible solution.

There might be a non-JS way to do this, but I haven’t been able to figure one out yet. I’m not the best at working with variables in the list window.

Massive thank you in advance!