sorich87 / bootstrap-tour

Quick and easy product tours with Twitter Bootstrap Popovers
http://bootstraptour.com
MIT License
4.44k stars 942 forks source link

Tour does not work if name contains spaces #633

Closed sh977218 closed 6 years ago

sh977218 commented 7 years ago

If the tour's name has space in it. Tour will not work. My assumption is the local storage retrieve the value using the dot notation ( localStorage.key ). If key has space in it, game over. It should be localStorage[key].

Pamblam commented 6 years ago

Finding this issue helped me solve my own problem so thank you, however, the docs do explicitly say spaces are not allowed:

The name should contain only alphanumerics, underscores and hyphens.

I turned storage off and the space still broke it for me, so my assumption is that your assumption is wrong :)

sh977218 commented 6 years ago

My assumption is that is using {}.key instead of {}[key]. because [key] will work with key that has space, but .key will not. Thank you for letting me know that API says it. I'll close this.

Pamblam commented 6 years ago

you can't use dot notation with variable names ;) it has to be using square brackets or it wouldn't be working at all