jQuery.NameSpace

未知
未知
2008-09-19

Easy way to create a namespace structure

This plugin works for you to provide for your code a structure on namespaces.

The Example:

<script language="JavaScript">
<!--
  $.namespace("validate", {
    isFullName: function(elems){
      return elems.val().indexOf(" ") > -1;
    },
    isNick: function(elems){
      return elems.val().indexOf(" ") == -1;
    },
    isEmail: function(elems){
    return elems.val().match(/^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/);// erro;
    }
  });

  checkFullName = function(){
    ($("#myFullName").validate.isFullName())? alert('Valid'): alert('invalid');
  }

Plugin page:
http://gsaraiva.projects.pro.br/?page_id=52

My site:
http://gsaraiva.projects.pro.br/

加载中

评论(0)

暂无评论

暂无资讯

暂无问答

暂无博客

返回顶部
顶部