squiffy.story.go not working in a button

Hi all,
New to Squiffy (and loving it). I've googled around quite a bit for an answer here and can't seem to find anything. It's entirely possible I'm mixing JS and Squiffy incorrectly, any guidance would be appreciated.

I'm attempting to put a button at the bottom of my Section that allows users to check their 'inventory'. The inventory is a standalone section( [inventory] ) that functions as expected when a passage link is set to it. Here's my button setup:

<button type="button"
<button onClick=squiffy.story.go("inventory");>Inventory.</button>

The button displays as expected, but clicking it will not prompt the [inventory] passage.
I've also tried removing the button logic entirely and simply entering:

squiffy.story.go("inventory")

This also fails to trigger the [inventory] passage. Is there something I'm doing incorrectly with squiffy.story.go? Do I need to activate some additional js code in order to enable this?

Thank you!
Will


Out of my league here. Have you tried standard JS code in the button (like setting a boolean to true)? Does that work? Are there other squiffy commands you can also try?

Just trying to narrow down what could be the problem - I suck at JS code, frankly.


Your button is missing quotes. Does it help if you do:

<button onclick="squiffy.story.go('inventory');">Inventory.</button>

Log in to post a reply.

Support

Forums