I set the value of the #thimble hidden field when the page loads using values ββon the server side.
Then in JavaScript, I want to work on this value only if it was filled with some non-empty string.
Is this the shortest way to verify that a value is not empty?
if ($("#thimble").val() != null && $("#thimble").val().length > 0) { carryOn(); }
Seems pretty long.
javascript jquery string null
Billy G.
source share