mozilla

Revision 328457 of Template:EmbedLiveSample

  • Revision slug: Template:EmbedLiveSample
  • Revision title: Template:EmbedLiveSample
  • Revision id: 328457
  • Created:
  • Creator: Sheppy
  • Is current revision? No
  • Comment

Revision Content

<% // Embeds a live sample given the ID of its header block. // // Parameters: // $0 - The ID of the header block containing the sample // $1 - The width of the iframe (optional) // $2 - The height of the iframe (optional) var widthHeight = ""; if ($1 && $2) { widthHeight = "width='$1' height='$2' "; }

Revision Source

<%
// Embeds a live sample given the ID of its header block.
//
// Parameters:
//  $0 - The ID of the header block containing the sample
//  $1 - The width of the iframe (optional)
//  $2 - The height of the iframe (optional)

var widthHeight = "";
if ($1 && $2) {
    widthHeight = "width='$1' height='$2' ";
}
<iframe <%=widthHeight%>src="<%= template('LiveSampleURL', [$0]) %>"></iframe>