[Pas2js] Initial resource linking support added.

Michael Van Canneyt michael at freepascal.org
Tue Oct 29 14:31:22 CET 2019



On Tue, 29 Oct 2019, warleyalex via Pas2js wrote:

> Another approach: Loading HTML templates from the script tag.
>
> e.g.
>
>
> live preview:
> https://pas2js.github.io/master/projhtmltemplateresource/index.html
> download project:
> https://pas2js.github.io/master/projhtmltemplateresource.rar

This kind of thing:

---
<script type="application/json" id="resource-pj2" data-type="interface" data-name="pas2js2" data-compressed="false">M
<!doctype html>M
<html><head>M
                 <meta charset="utf-8">M
                 <title>Test</title>M
         <style class="cssdeck">div#theatre {M
     border: inset red 10px;M
     height: 300px;M
     width: 80%;M
     margin: 2em auto;M
     text-align: center;M
     line-height: 120px;M
     font-size: 30px;M
     position: relative;M
     overflow: hidden;M
---

is not recommended. This is likely to break in the future, because browsers become more and more picky about what they accept.

I aleady had to modify my original code because for example firefox didn't warn, but chrome did warn about what is acceptable in <link> tags.

So mixing things is IMO not a good idea and likely to break in the future.

Michael.


More information about the Pas2js mailing list