Ajax asynchronous press Enter to submit the form

Author: The story I forgot ¢
personal micro-channel public number: program ape fight with

html

<form id="findInvis">
        帖子标题:
        <input title="请输入帖子标题" name="title">
        <!--input的类型还是submit-->
        <input type="submit" value="搜索" >
</form>

js

/**
 * 点击查找按钮/提交表单,设置提交方法,但是返回false
 */
$("#findInvis").submit(function () {
    //按下回车/提交按钮后的操作
    findBy(1);
    //返回false
    return false;
});

Whether isEmpty () determines input box empty

isEmpty:

Analyzing the function parameter is not empty, only a character (String), the object (Object), the array (Array),

Not available for numeric and Boolean, illustrated:

  1. Null: null, '' (the empty string), undefined returns are true.

    Ex:

    isEmpty(null), isEmpty(''), isEmpty(undefined)The determination result is true

    2.boolean type true, false returns are true.

​ Ex:

isEmpty(true), isEmpty(false)The determination result is true

isEmpty('true'), isEmpty('false')The parameter as a string, the result is false judgment

3.number type 0,1,2 returns are true

isEmpty(0), isEmpty(1), isEmpty(2)The determination result is true

isEmpty('0'), isEmpty('1'), isEmpty('2')The determination result is false

Guess you like

Origin www.cnblogs.com/jsccc520/p/12000640.html