MyTechDictionary

Technical Question Answers related to dotnet, dbms, sql, wcf ,ajax,jquery etc

Tuesday, 20 May 2014

Jquery code to check undefined value




Note that typeof always returns a string, and doesn't generate an error if the variable doesn't exist at all.

function A(val){
  if(typeof(val)  === "undefined")
    //do this
  else
   //do this
}



Posted by Shrikant at 00:52
Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest

No comments:

Post a Comment

Newer Post Older Post Home
Subscribe to: Post Comments (Atom)

Blog Archive

  • ▼  2014 (23)
    • ▼  May (13)
      • Difference between IEnumerable VS IQueryable
      • How to Call a Service Method Asynchronously using WCF
      • How to find the available endpoints for a WCF service
      • How to select a service endpoint in WCF
      • Windows Communication Foundation Services and WCF ...
      • JQuery Comparison and Logical operators
      • Jquery code to check undefined value
      • Difference between WCF and Web API and WCF REST an...
      • What is Web API and why to use it ?
      • Difference between ASP.NET 2.0 and ASP.NET 3.5
      • Differences between asp.net 1.0, asp.net 1.1 and a...
      • Differences between ASP.NET 3.5 and ASP.NET 4.0
      • What is a Design Pattern?
    • ►  February (8)
    • ►  January (2)
  • ►  2013 (2)
    • ►  December (2)

About Me

Shrikant
View my complete profile
Simple theme. Powered by Blogger.