While working on a jsp file, I came across a span tag with the following code:
<span id="divBasicSearchResults" style="height:100%;"></span>
Below is the Javascript function that generates HTML content for this span:
function renderBasicSearchNarrative1(response) {
var html = '';
var i = 0;
var j = 0;
if(response){
html += '<table><tr><th colspan="5">Search Results</th></tr>';
html += '<tr><td><b>#</b></td><td style="min-width:150px;"><b>Name</b></td><td><b>Lat/Long</b></td></tr>';
html += '<tbody>';
for(var i =0; i < response.length; i++){
var result = response[i];
var resultNum = i+1;
if(result.lat>47.33 && result.lat<48.92 && result.lon>9.8 && result.lon<13.46){
html += "<tr valign=\"top\">";
html += "<td>" + resultNum + "</td>";
html += "<td>";
if(result.display_name){
var new_display_name = result.display_name.replace(/,/g, ",<br />");
html += new_display_name;
}
html += "</td>";
html += "<td>" + result.lat + ", " + result.lon + "</td>";
addmarker(result.lat, result.lon, "map-pointer-icon.png");
html += "</tr>";
}
}
html += '</tbody></table>';
}
document.getElementById('divBasicSearchResults').style.display = "";
document.getElementById('divBasicSearchResults').innerHTML = html;
In the above code snippet, I am dynamically generating HTML code to be displayed on the jsp file. However, I am only seeing a part of the generated code in my span tag, which looks like this:
Search Results
#Name Lat/Long
If anyone has suggestions on how to resolve this issue, please feel free to share. Thank you!