以问号开头的HTML标签? [英] Html tag beginning with question mark?

查看:31
本文介绍了以问号开头的HTML标签?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在学习谷歌应用脚​​本,并且在 this 教程,我看到了一些看起来很奇怪的语法:<?/* JS 代码 */?>

I'm learning google apps script, and in this tutorial, I saw some weird looking syntax: <? /* JS code */ ?> and <?= /* JS code */ ?>

<!DOCTYPE html>
<html>
  <head>
    <base target="_top">
    <title>Message Display Test</title>
    <link rel="stylesheet" href="https://ssl.gstatic.com/docs/script/css/add-ons1.css">
  </head>
  <body style="padding:3em;">
  <h1>Messages</h1>
    <ul>
    <? for(var m=0;m<messages.length;m++){ ?>
    <li><?= messages[m].getSubject() ?></li>
    <p><?= messages[m].getPlainBody() ?></p>
    <? } ?>
    </ul>
  </body>
</html>

我可以理解发生了什么,但我仍然感到困惑.我在学习 HTML 时从未见过这些.这与脚本标签相比如何?

I can kind of understand what is going on, but I'm still confused. I've never seen these while learning HTML. How does this compare to script tags?

推荐答案

在 Google Apps 脚本中 被称为标准小脚本 <?= ...?> 是打印的 scriptlet 和 <?!= ...?> 是强制打印脚本.它们用于 Google Apps Script HTML Service 模板化 HTML.

In Google Apps Script <? . . .?> are called standar scriptlets, <?= . . . ?> are printed scriptlets and <?!= . . . ?> are force printing scriplets. They are used in Google Apps Script HTML Service templated HTML.

资源

相关

这篇关于以问号开头的HTML标签?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆