I have a bit of JS code that looks like this–
[code]
if (userSearch != 0) {
if (mlscount < searchTotal) { var count = “Displaying ” + mlscount + ” of ” + searchTotal; } else { var count = “Displaying ” + searchTotal; }
document.getElementById(‘searchResults’).innerHTML = “<p style=’color: red;’>” + count + ” matching properties in this view.</p><p>Zoom in or move the map with your mouse for more results.</p>”; }
Now, where you see the if (mlscount > searchTotal) is where the problem is. I have the two vars echoed out on my webpage, mlscount is equal to ’75’ and searchTotal is equal to ’20’ but the JS is still executing that if statement as–
Displaying 75 of 20
It should be showing the else as
Displaying 20
What is going on?