Class Anchor


Deprecated. The UI service was deprecated on December 11, 2014. To create user interfaces, use the HTML service instead.

A widget that represents a simple <a> element. That is, a hyperlink to a different page.

By design, these hyperlinks always open in a new page. Links that reload the current page are not allowed.

Here is an example of how to use this widget:

 function doGet() {
   var app = UiApp.createApplication();
   // Creates a link to your favorite search engine.
   var anchor = app.createAnchor("a link", "");
   return app;

Internally, UiApp widgets are built on top of the Google Web Toolkit, and it can sometimes be helpful to look at the GWT documentation directly. You can find the Anchor documentation here.

Deprecated methods


Apps Script
Apps Script