content Object|String

Specifies a URL or request options from where the Window will load its content.

For URLs which start with a protocol (for example, http://), a container iframe element is automatically created. As this behavior may change in future versions, try to always use the iframe configuration option.

Example - fetching content from the server

<div id="dialog"></div>
  content: "/details"

content.template String

The template for the content of a Window. Returned data from the server will be given as the data of this template.

If the returned data is JSON, the dataType parameter has to be passed so that the data gets parsed by jQuery.

If the URL contains a protocol, set iframe to false. Otherwise, the JSON response will be injected in the content area of the Window as is.

Example - fetching JSON and displaying it through a template

<div id="dialog">
    <p><strong>This example will not work unless you define a valid JSON service URL for `content.url`.</p>
    <p>The expected JSON response is:

        { username: " username here..." }


  content: {
    url: "/userDetails",
    dataType: "json",
    iframe: false,
    template: "User name: #= data.username #"
In this article
Not finding the help you need? Improve this article