Class HtmlOutputMetaTag
Organiza tus páginas con colecciones
Guarda y categoriza el contenido según tus preferencias.
EtiquetametadesalidaHTML
Es un objeto que representa una metaetiqueta agregada a la página mediante una llamada a HtmlOutput.addMetaTag(name, content)
.
const output = HtmlService.createHtmlOutput('<b>Hello, world!</b>');
output.addMetaTag('viewport', 'width=device-width, initial-scale=1');
const tags = output.getMetaTags();
Logger.log(
'<meta name="%s" content="%s"/>',
tags[0].getName(),
tags[0].getContent(),
);
Métodos
Método | Tipo de datos que se muestra | Descripción breve |
getContent() | String | Obtiene el contenido de esta etiqueta meta. |
getName() | String | Obtiene el nombre de este HtmlOutputMetaTag . |
Documentación detallada
getContent()
Obtiene el contenido de esta etiqueta meta.
Volver
String
: Es el contenido de esta metaetiqueta.
getName()
Obtiene el nombre de este HtmlOutputMetaTag
.
Volver
String
: Es el nombre de esta metaetiqueta.
Salvo que se indique lo contrario, el contenido de esta página está sujeto a la licencia Atribución 4.0 de Creative Commons, y los ejemplos de código están sujetos a la licencia Apache 2.0. Para obtener más información, consulta las políticas del sitio de Google Developers. Java es una marca registrada de Oracle o sus afiliados.
Última actualización: 2025-07-26 (UTC)
[null,null,["Última actualización: 2025-07-26 (UTC)"],[[["\u003cp\u003e\u003ccode\u003eHtmlOutputMetaTag\u003c/code\u003e objects represent meta tags added to HTML pages using \u003ccode\u003eHtmlOutput.addMetaTag()\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eThese objects allow you to access the name and content of the meta tag through \u003ccode\u003egetName()\u003c/code\u003e and \u003ccode\u003egetContent()\u003c/code\u003e methods.\u003c/p\u003e\n"],["\u003cp\u003eYou can retrieve all added meta tags using \u003ccode\u003eHtmlOutput.getMetaTags()\u003c/code\u003e and iterate through them.\u003c/p\u003e\n"]]],[],null,["# Class HtmlOutputMetaTag\n\nHtmlOutputMetaTag\n\nAn object that represents a meta tag added to the page by calling [HtmlOutput.addMetaTag(name, content)](/apps-script/reference/html/html-output#addMetaTag(String,String)).\n\n```javascript\nconst output = HtmlService.createHtmlOutput('\u003cb\u003eHello, world!\u003c/b\u003e');\noutput.addMetaTag('viewport', 'width=device-width, initial-scale=1');\n\nconst tags = output.getMetaTags();\nLogger.log(\n '\u003cmeta name=\"%s\" content=\"%s\"/\u003e',\n tags[0].getName(),\n tags[0].getContent(),\n);\n``` \n\n### Methods\n\n| Method | Return type | Brief description |\n|-------------------------------|-------------|--------------------------------------------------|\n| [getContent()](#getContent()) | `String` | Gets the content of this meta tag. |\n| [getName()](#getName()) | `String` | Gets the name of this `Html``Output``Meta``Tag`. |\n\nDetailed documentation\n----------------------\n\n### `get``Content()`\n\nGets the content of this meta tag.\n\n#### Return\n\n\n`String` --- the content of this meta tag.\n\n*** ** * ** ***\n\n### `get``Name()`\n\nGets the name of this `Html``Output``Meta``Tag`.\n\n#### Return\n\n\n`String` --- the name of this meta tag."]]