c-smile / sciter-sdk

Sciter is an embeddable HTML/CSS/scripting engine
http://sciter.com
Other
2.11k stars 224 forks source link

microformat no longer works #154

Closed AshfordN closed 4 years ago

AshfordN commented 4 years ago

Element.append() and similar functions that use the microformat no longer work, and causes the program to crash.

c-smile commented 4 years ago

Microformat works but it is more strict I would say and aligned with the SSX.

So you can use either this:

$(body).append([div: {class:"foo"}, ["hello world"]]);

or this

$(body).append( <div.foo>hello world</div> );

which are technically the same expressions.

AshfordN commented 4 years ago

Which format is preferred going forward?

c-smile commented 4 years ago

Just use SSX:

<html>
    <head>
        <title>Test</title>
        <style>

        </style>
        <script type="text/tiscript">

const data = ["Banana","Appricot","Apple"];

const rows = data.map( fruit => <tr><td>{fruit}</td></tr> );

$(body).append(
    <table border>
        <tbody>{rows}</tbody>
    </table>
);

        </script>
    </head>
    <body>
    </body>
</html>
AshfordN commented 4 years ago

I've got it working. Thanks for your help.