Hiding a div in response to data not being found

Hiding a div in response to data not being found

I have a grid that is being displayed with data that comes from a static xml file.  I need to conditionally display a div in response to whether data is present at a particular xml node.  Is there a way to do this via jQuery??  I have tried doing it via straight js, but all I end up doing is permanently hiding the div I am messing with.

if data within the xml node is present - display the div.  If no data is present in the xml node - hide the div.

But my code below permanently hides the div.  Help.

  1. onSelectRow: function() {
                    var gsr = $('#searchResults').jqGrid('getGridParam', 'selrow');
                    if (gsr) {
                        var data = $('#searchResults').jqGrid('getRowData', gsr);
                        $('#basicMun #dodic').append('DODIC:  ' + data.dodic);
                        $('#basicMun #title').append('Nomenclature:  ' + data.nomenclature);
                        $('#basicMun #purpose').append('Use:  ' + data.purpose);
                        $('#basicMun #description').append('Description:  ' + data.description);
                       
                        if ($(data.olValue.length < 1)) {
                            $('#basicMun #objLength').hide();}
                            else {$('#basicMun #objLength').append('Length:  ' + data.olValue + ' ' + data.olUnit);
                            };
                         $('#basicMun #objWidth').append('Width:  ' + data.objWidthvalue + ' ' + data.objWidthunit);















        .... script continues on with placing data from xml nodes into specified divs for display to user.

I have tried my if/else statement both ways with less than 1 and then greater than 0 for the conditional.  I have verified that there is data within the node and is being reported in firebug.


It is not the job you get handed, but what you have done with it in the end that people remember.