c-smile / sciter-sdk

Sciter is an embeddable HTML/CSS/scripting engine

Home Page:http://sciter.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

microformat no longer works

AshfordN opened this issue · comments

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

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.

Which format is preferred going forward?

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>

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