Notice: Undefined index: HTTP_REFERER in /home/eswcontest/public_html/admin/bbs/down.php on line 6
FAQ

4. FAQ

Table of Contents

How are click / touch events handled in Web Widgets?

The Web Widget engine supports only an onclick event handler for click and touch events. Implement and bind an event handler to the target element. For details, see onclick Event.

Can heading styles be applied to text?

The Web Widget engine does not support HTML heading styles (h1, h2, ..., h6). Heading styles are typically used to structure Web pages displayed in browsers. To make heading text, apply a suitable CSS font-style

Can I use hyperlinks in Web Widgets?

The Web Widget engine does not support hyperlink functionality. To change from the current Web Widget page, use a CSS transition or implement your service as a Web application.

What font styles are supported?

The Web Widget engine supports the br and span tags for text-level semantics. (See HTML tag). You can also use CSS properties to make text display like text with text-level semantics tags applied. The following are examples of typical tag / CSS property correlations.

Tags Not Supported Similar CSS properties and values
strong font-weight:bold
small font-size:smaller
s text-decoration: line-through
sub vertical-align:sub and font-size: smaller
sup vertical-align:super and font-size: smaller
i font-style: italic
b font-weight: bold
u text-decoration: underline

What is the best way to use the img tag?

To increase performance and reduce memory size, the Web Widget engine imposes 2 limitations on the img tag:

Why can't I use iframes?

Typically, iframes are used for embedding another document within the current document. However, Web widgets provide simple services and content. Therefore, the Web Widget engine does not support iframes.

What media elements are supported?

The Widget Web engine supports only the img tag, and does not support audio / video tags.

How can I create tables?

The Web Widget engine does not support the table HTML tag. Create a table-like layout using the div and border tags in code such as the following.

# CSS Style
<style>
  body {
    position:absolute;
    margin: 0px;
    padding: 0px;
    top:0px;
    left:0px;
    width:360px;
    height:360px;
    font-size: 1.125rem;
    color: Black;
    background-color: White;
  }

  #leftDiv {
    text-align: center;
    border: 1px solid red;
  }

  #rightDiv {
    text-align: center;
    border: 1px solid red;
    margin-left: -5px;
  }

  .split {
    display: inline-block;
    width: 45%; height: 100%;
  }
</style>

# Table like div
<div id="parentDiv">
  <div class="split" id="leftDiv">
    First Name
  </div>
  <div class="split" id="rightDiv">
    Last Name
  </div>
</div>
<div id="parentDiv">
  <div class="split" id="leftDiv">
    Eve
  </div>
  <div class="split" id="rightDiv">
    Jackson
  </div>
  <div class="split" id="leftDiv">
    John
  </div>
  <div class="split" id="rightDiv">
    Doe
  </div>
  <div class="split" id="leftDiv">
    Adam
  </div>
  <div class="split" id="rightDiv">
    Johnson
  </div>
</div>

What kind of forms can I use?

The Web Widget engine does not support the form tag. However, you can create form-like elements using the div tag and CSS styles.

How can I mimic select elements instead of using querySelector?

The Web Widget engine does not support the querySelector method. However, you can create and alternative select element in code such as the following.

var parent = document.getElementById('parentDiv');
var c = parent.children;
var i;

for (i = 0; i < c.length; i++) {
  if (c[i].id === 'leftDiv') {
    // Do Something
  }
}

How can I retrieve nodes witout NodeIterator?

The Web Widget engine does not support the NodeIterator object. Retrieve the children attribute of a node via code such as the following.

var c = document.body.children;
var i;

for (i = 0; i < c.length; i++) {
  c[i].style.backgroundColor = "red";
}

Is innerHTML or innerText supported?

The Web Widget engine does not support innerHTML and innerText properties. To get the text data of an element, use textContent in code such as the following.

var parent = document.getElementById('parentDiv');
var parentText = parent.textContent;

How can logging be performed in the emulator?

By using console.log in JavaScript code, you can see the logs in the SDK.

Why does the responseXML property return undefined?

XMLHttpRequest() is supported only for the text data type. Therefore, the responseXML property is not necessary.

Where can I find a guide for using response and responseType attributes?

Guidelines are not necessary because the XMLHttpRequest() is only for the text data type. For more information, see the XMLHttpRequest section.

How can I change Web widget text font?

For performance reasons, the Web Widget engine does not support the font-family CSS property. However, you can use combinations of font-size, font-weight, and font-style to change your Web widget font.

Can I set a border style like border-radius?

The Web Widget Specification restricts some of properties and values related to border-radius. For more information, see the Border section.

Can images be animated without a 2-D canvas?

The Web Widget Specification supports requestAnimationFrame() and CSS transform for implementing animations. For sample code, see the Animation section

Is the Web Widget Specification a new Web standard?

No, the Web Widget Spec is a limited set of the W3C standard specification. Web widget APIs are a subset of the Tizen device APIs.

Which tags and properties can I use?

See the API reference in the Web Widget Specification document.

How can I design my Web widget layout for a circular shape?

There are no specific functions for a circular shape. For circular layout samples, see the Layout section.

Can I use external JavaScript and CSS libraries?

According to the Web Widget Specification, the content size of each Web widget is limited to 50 kB. For Web widget content that is less than or equal to 50 kB, JavaScript or CSS files can be included. However for the performance reasons, the files cannot be imported from an external network. For more details, see the External Network Resource section.

What kind of events can I use for user interaction?

Due to UX restrictions, Web widgets only allow the use of onclick events for user interaction.

How can I access the Internet from a Web widget and what restrictions are there?

Accessing Internet is available via XMLHttpRequest(). For example code, see the Communication with the Web sections.

Is it possible to implement only Web widget without Web application?

For developer convenience during testing and debugging only, the Web Widget engine supports an Only Web Widget Mode. To distribute Web widgets via the Application Store, each Web widget has to have at least 1 parent Web application in the package. For more details, see the Web Widget Application Model section.

How can I determine which APIs are supported in Web widgets?

For the APIs supported by the Web Widget Specification, see the Reference section. Additionally, Tizen SDK provides a Web Widget Validator to indicates whether or not a typed-in API meets the Web Widget Specification.

Can Web widgets re-use the JavaScript library or CSS styles of their parent Web application?

Because Web app and Web widget resources are isolated from each other, Web widgets cannot use their Web app JavaScript or CSS files. The virtual root path of the Web app and its Web widgets are not the same. It is possible to copy Web app JavaScript and CSS files to a Web widget's folder. However, the Web Widget Specification places more restrictions on Web widget files than on Web app files. Therefore, verify all copied Web app JavaScript and CSS files using the Web Widget Validator.

What are the benefits of Web widget apps compared with native widget apps?

Because Web widget apps are implemented via the Web spec, there are many Web-friendly developers who can create Web widget apps more easily and more quickly than native widget apps.

What type of content is best for Web widget apps?

Typically as part of a Web application, Web widgets provide their users with important Web app functions (such as launching the parent Web app), and brief, important Web app data and information. Therefore, simple and lightweight services are suitable Web widget applications.

Can I use CSS ellipsis?

Currently, CSS ellipsis is not supported. However, string length can be limiting by using the JavaScript. For related code, see the 'Scrolling Text' sample in the Animation section.

Do my customers download Web widget apps when downloading a Web app?

Yes, Web widgets must be packaged together with their parent Web app. The entire package is distributed to customers via the Application Store.

Is creation initiated by the add widget action and by the resume widget action?

After creation is initiated by an add widget action, a resume action is not triggered. A resume action is triggered only when a Web widget is shown after being hidden (by rotating the Gear device bezel). For Web widget lifecycle details, see the Overview section.

When a Web widget is removed, what events are fired?

After removal, no corresponding event is fired because it is considered that no event is needed for termination.

What are the Web widget file size limitations (HTML, CSS, JavaScript)?

For Web widget file and image size limits, see the