PageRenderTime 38ms CodeModel.GetById 13ms RepoModel.GetById 0ms app.codeStats 0ms

/documentation/appframework/$.is$.md

https://github.com/maoyao/appframework
Markdown | 44 lines | 29 code | 15 blank | 0 comment | 0 complexity | efe1a8983cefac85a196e2e414e0e59b MD5 | raw file
  1. #$.is$(param)
  2. ```
  3. Checks to see if the parameter is a $afm object
  4. ```
  5. ##Example
  6. ```
  7. var foo=$("#header");
  8. $.is$(foo);
  9. ```
  10. ##Parameters
  11. ```
  12. element Object
  13. ```
  14. ##Returns
  15. ```
  16. Boolean
  17. ```
  18. ##Detail
  19. $.is$ checks to see if the instance of an object is of type "$" or "$afm or App Framework. This is usefull for checking for parameter types in functions.
  20. ```
  21. var tmp = $("div");
  22. var bar=null;
  23. function test(el){
  24. if($.is$(el)) //if we have an App Framework object, get the first element
  25. el=el[0];
  26. };
  27. alert(test(tmp));//true
  28. alert(test(bar));//false
  29. ```