Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. .NET (Core and Framework)
  4. How to check null string in java script

How to check null string in java script

Scheduled Pinned Locked Moved .NET (Core and Framework)
javajavascripttoolshelptutorial
5 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    Rmesh
    wrote on last edited by
    #1

    hi friends i have how to javascript string null value i have get the sessin value in one string variable var ListId='<%=Session["LiatingId"]%>'] if(ListId != ""){ alert('not null')} else alert('null') if the listid is null then also alert('not null ')is executed how to solve this problem Thanks in Advance

    V A 2 Replies Last reply
    0
    • R Rmesh

      hi friends i have how to javascript string null value i have get the sessin value in one string variable var ListId='<%=Session["LiatingId"]%>'] if(ListId != ""){ alert('not null')} else alert('null') if the listid is null then also alert('not null ')is executed how to solve this problem Thanks in Advance

      V Offline
      V Offline
      Vasudevan Deepak Kumar
      wrote on last edited by
      #2

      What does Viewsource show up? Did you check with length?

      Vasudevan Deepak Kumar Personal Homepage Tech Gossips

      R 1 Reply Last reply
      0
      • V Vasudevan Deepak Kumar

        What does Viewsource show up? Did you check with length?

        Vasudevan Deepak Kumar Personal Homepage Tech Gossips

        R Offline
        R Offline
        Rmesh
        wrote on last edited by
        #3

        yes i have solved that problem,using string.length function

        V 1 Reply Last reply
        0
        • R Rmesh

          yes i have solved that problem,using string.length function

          V Offline
          V Offline
          Vasudevan Deepak Kumar
          wrote on last edited by
          #4

          Actually even in C#, the length comparison is considered faster than string.Empty == strVariable

          Vasudevan Deepak Kumar Personal Homepage Tech Gossips

          1 Reply Last reply
          0
          • R Rmesh

            hi friends i have how to javascript string null value i have get the sessin value in one string variable var ListId='<%=Session["LiatingId"]%>'] if(ListId != ""){ alert('not null')} else alert('null') if the listid is null then also alert('not null ')is executed how to solve this problem Thanks in Advance

            A Offline
            A Offline
            Akhilesh Yadav
            wrote on last edited by
            #5

            I've done scripting long back but i think javascript treats null as "null" [string] U need to check these string rather than checking the empty state. Just give a try

            --Akki

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups