User Interface‎ > ‎

Anchor

In this example, I have made some demo for Anchor with different stylings.
First anchor opens in same window.

Reference:

Example Demo:

 
 

Example Code:
function doGet() {
  var app = UiApp.createApplication();
  var panel = app.createVerticalPanel();
  //Create Anchor
  var anchor1 = app.createAnchor('Anchor 1', 'http://www.google.com');
  //Setting the anchor href using setHref
  var anchor2 = app.createAnchor('Anchor 2', '').setHref('http://www.google.com');
  
  //Add the anchors to panel
  panel.add(anchor1).add(anchor2);
  
  //Add the panel to the application
  app.add(panel);
  return app;
}



Comments