I have the following HTML with jQuery code:
<div id="info" style="width: 100%; height: 280px; overflow-y: scroll;"></div>
var url1 = cbcWMS1.getGetFeatureInfoUrl
(evt.coordinate, viewResolution, 'EPSG:3857', {'INFO_FORMAT': 'text/html'});
$('#info').append('<iframe width="99%" seamless src="' + url1 + '"</iframe>');
The string url1
returns an iframe
element of a table with elements.
How can I access the elements in the iframe
?
I would like to add a condition where if the iframe
lacks contents, the whole <div id='info'>
can be hidden using jQuery.
The string: url1
contains the following code:
<body>
<table class="table table-hover table-condensed">
<h3>${type.name}</h3>
<head>
<tr>
<#list type.attributes as attribute>
<#if !attribute.isGeometry>
<th>${attribute.name}</th>
</#if>
</#list>
</tr>
</head>
<body>
<#assign odd = false>
<#if odd>
<tr class="odd">
<#else>
<tr>
</#if>
<#assign odd = !odd>
<#list features as feature>
<#list feature.attributes as attribute>
<#if !attribute.isGeometry>
<td>${attribute.value}</td>
</#if>
</#list>
</tr>
</#list>
</body>