MDN/Archives/Kuma/Scripting: Difference between revisions

Jump to navigation Jump to search
no edit summary
No edit summary
No edit summary
Line 104: Line 104:
</pre>
</pre>


Long-form templates become [https://github.com/visionmedia/ejs embedded JS templates],
Long-form templates become [https://github.com/visionmedia/ejs embedded JS templates], something like this:<pre>
something like this:<pre>
<%
<%
     /* accepts as input one required parameter: HTML element to create a xref to */
     /* accepts as input one required parameter: HTML element to create a xref to */
Line 137: Line 136:
     } else { /* the page doesn't exist */
     } else { /* the page doesn't exist */
       var targeturi = "https://developer.mozilla.org/Article_not_found?uri=" .. dest;
       var targeturi = "https://developer.mozilla.org/Article_not_found?uri=" .. dest;
       %> <code><a rel="internal" href="<%= targeturi %>" class="new"><%- web.text('<' .. name .. '>') %></a></code> <%
       %> <code><a rel="internal" href="<%= targeturi %>" class="new"><%- web.text('<' + name + '>') %></a></code> <%
     }
     }
%>
%>
</pre>
</pre>
The above presupposes an API similar to what's exposed to DekiScript, is
non-functional, and mainly serves as a thought experiment in comparative
syntax.


=== Sandboxed JavaScript execution ===
=== Sandboxed JavaScript execution ===
Confirmed users
920

edits

Navigation menu