Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sugarcube basic stuff "no elements matched the selector" ???

It bordered me a while.

I have a passage with only one single line
<span id="morning"> ... Waken up.</span> <<link "Wake up">><<addclass "#morning" "hiddenspan">><</link>>

.hiddenspan is a class defined in the story css, which I think is a non-factor.

When I test display loading only this page, I got this error.
... Waken up. Wake up
Error: <<addclass>>: no elements matched the selector "#morning"Error: macro <</link>> does not exist

I think it is pretty basic. Almost a straight copy and paste from the Macro Library.

It happens to link/button, with all replace, addclass, removeclass. I think for some reasons the span is not built before the addclass looking for the span-id. My question is ... WHY? It is basically the sample code from the macro library? Is there a setting somewhere I set wrong?

I can write postdisplay scripts... but I would be appreciated if someone solves the mystery for me.

Comments

  • Please use the code tag when posting code--it's 'C' on the editor bar.

    The basic issue is the closing <</link>> tag being unrecognized. What version of SugarCube are you using? The current version is v2.11.0 and <<link>> requires at least v2.8.0.
  • I am... speechless.

    I was so ready to tell you that you are wrong. I had the latest version of sugarcube. I installed it only recently. It wasn't so long ago.

    I started to figure out the version number. I found a "2.0.0.beta7" in the header.html. I was shocked. I downloaded the latest version, and, boom, everything is working right.

    A million thanks. You make my day, plus saving me a tones of work in the future for all the workarounds. Double thumb up.
Sign In or Register to comment.