jQuery if语句,语法 [英] jQuery if statement, syntax

查看:89
本文介绍了jQuery if语句,语法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

什么是简单的jQuery语句,表明只有在A和B为真时才会进行操作?如果A不成立,请停止。如果A和B为真,则继续。
`

What is a simple jQuery statement that states an operation proceeds only if A and B are true? If A isn't true, stop. If A and B are true, then continue. `

推荐答案

jQuery只是一个在Web浏览器中增强DOM功能的库;底层语言是JavaScript,正如您可能希望从编程语言中获得的那样,它具有执行条件逻辑的能力,即

jQuery is just a library which enhances the capabilities of the DOM within a web browser; the underlying language is JavaScript, which has, as you might hope to expect from a programming language, the ability to perform conditional logic, i.e.

if( condition ) {
    // do something
}

测试两个条件也很简单:

Testing two conditions is straightforward, too:

if( A && B ) {
    // do something
}

亲爱的上帝,我希望这不是一个巨魔......

这篇关于jQuery if语句,语法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆