首页 \ 问答 \ 单选按钮未在jQuery中检查(Radio buttons not checked in jQuery)

单选按钮未在jQuery中检查(Radio buttons not checked in jQuery)

我有这行代码页面加载:

if ($("input").is(':checked')) {

当单选按钮输入被选中时,它工作正常。 但是,我想要相反。 沿线的东西

if ($("input").not(.is(':checked'))) {

所以当没有选择任何单选按钮时,if语句运行。 什么是最好的方法呢?


I have this line of code for page load:

if ($("input").is(':checked')) {

and it works fine when the radio button input is checked. However, I want the opposite. Something along the lines of

if ($("input").not(.is(':checked'))) {

so that my if statement runs when none of the radiobuttons are selected. What is the best way to go about this?


原文:https://stackoverflow.com/questions/372325
更新时间:2023-05-28 08:05

最满意答案

我遇到了同样的问题。 我参考了这个教程并且它有效 - http://hintdesk.com/how-to-tweet-in-twitter-within-android-client/comment-page-1/

并且他们已经更新到twitter4j-core-4.0.1

源代码可以在这里找到 - https://bitbucket.org/hintdesk/android-how-to-tweet-in-twitter-within-android-client


I was having the same problem. I referred to this tutorial and it works - http://hintdesk.com/how-to-tweet-in-twitter-within-android-client/comment-page-1/

and also they have updated to twitter4j-core-4.0.1

Source code can be found here - https://bitbucket.org/hintdesk/android-how-to-tweet-in-twitter-within-android-client

相关问答

更多
  • 除了d。的坚实选择外,您还可以: 使用ACTION_SEND Intents with createChooser() ,如果用户安装了Twitter应用程序(Twidroid),则可以使用它来更新其状态 使用现有的Twitter Java API,如JTwitter In addition to d.'s solid choices, you could: Use ACTION_SEND Intents with createChooser(), and if the user has a Twitter ...
  • 我遇到了同样的问题。 我参考了这个教程并且它有效 - http://hintdesk.com/how-to-tweet-in-twitter-within-android-client/comment-page-1/ 并且他们已经更新到twitter4j-core-4.0.1 源代码可以在这里找到 - https://bitbucket.org/hintdesk/android-how-to-tweet-in-twitter-within-android-client I was having the sa ...
  • 我认为您的解决方案是正确的,但让我们看看其他选择(您也可以向您的客户解释): 您可以启动发布一些文本(您的推文)的意图,并让用户处理客户端。 问题是你不能限制推出的应用程序,所以用户可以选择,例如Facebook,Whatsapp等。采取这种选择意味着你的分享按钮不会'通过推特分享'或类似的东西,因为你让用户在任何他想要的地方分享文本按钮应该简单地说'分享'(我认为这是最好的选择)。 如果您不想朝这个方向前进,我建议您解释一下您的客户(如果可以的话),Android有多个Twitter应用程序,如果用户有多 ...
  • 看起来你引用的那篇文章是在2012年10月写的,并使用了twitter API的v1。 最近Twitter已经退出了他们的API v1 。 因此,您必须找到使用最新API的其他教程,或尝试调试旧代码以使其与新API一起使用。 It looks like that article you reference was written in Oct of 2012 and uses v1 of the twitter API. Recently Twitter has retired v1 of their AP ...
  • 我已经添加了一个服务和详细说明如何使其适用于Android和iOS。 它使用InAppBrowser插件,适用于PhoneGap 3.1.0。 I have added a service and detailed decription on how to make it working for both Android and iOS. It uses InAppBrowser plugin and works for PhoneGap 3.1.0.
  • 试试吧 private Handler mHandler = new Handler() { @Override public void handleMessage(Message msg) { switch(msg.what){ case HIDE_PROGRESS_DIALOG:{ hideProgressDialog(); }break; case PROCESS_T ...
  • 试试Twitter4j Github链接 这个链接也有例子 try Twitter4j Github link This link has examples too
  • 在身份验证后重定向到回调URL是正常行为。 请先阅读一下OAuth的内容 。 回调URL用于将授权令牌传递回请求的应用程序。 您应该将其分配给应用程序内的URL,该URL可以读取令牌并使用该令牌采取必要的操作。 对于twitter4j,URL oauth://t4jsample能够处理此部分。 希望这对你来说很清楚。 Redirecting to callback URL after authentication is the normal behavior. Please read a bit about ...
  • 当我将Facebook和Twitter集成添加到我的应用程序(无耻插件: 秘密消息 )时,我试图通过Intent调用已安装的Twitter客户端应用程序。 这并不好玩,因为没有“facebook / text”或“twitter / text”意图。 我知道一些Twitter应用程序创建了自己的应用程序,但它们并未被普遍使用或甚至未知。 因此,另一个选项是获取所有已安装应用的列表,并对要在选择器中显示的用户进行过滤以供用户选择。 但是检索包列表及其用户友好名称需要永远。 所以我讨厌这个选择。 我最终将Fac ...
  • 使用twitter而不是twitter-core: compile('com.twitter.sdk.android:twitter:2.3.2@aar') { transitive = true; } 我测试了它并且使用注释处理器工作得很好。 Use twitter instead of twitter-core : compile('com.twitter.sdk.android:twitter:2.3.2@aar') { transitive = true; } I tested ...

相关文章

更多

最新问答

更多
  • 您如何使用git diff文件,并将其应用于同一存储库的副本的本地分支?(How do you take a git diff file, and apply it to a local branch that is a copy of the same repository?)
  • 将长浮点值剪切为2个小数点并复制到字符数组(Cut Long Float Value to 2 decimal points and copy to Character Array)
  • OctoberCMS侧边栏不呈现(OctoberCMS Sidebar not rendering)
  • 页面加载后对象是否有资格进行垃圾回收?(Are objects eligible for garbage collection after the page loads?)
  • codeigniter中的语言不能按预期工作(language in codeigniter doesn' t work as expected)
  • 在计算机拍照在哪里进入
  • 使用cin.get()从c ++中的输入流中丢弃不需要的字符(Using cin.get() to discard unwanted characters from the input stream in c++)
  • No for循环将在for循环中运行。(No for loop will run inside for loop. Testing for primes)
  • 单页应用程序:页面重新加载(Single Page Application: page reload)
  • 在循环中选择具有相似模式的列名称(Selecting Column Name With Similar Pattern in a Loop)
  • System.StackOverflow错误(System.StackOverflow error)
  • KnockoutJS未在嵌套模板上应用beforeRemove和afterAdd(KnockoutJS not applying beforeRemove and afterAdd on nested templates)
  • 散列包括方法和/或嵌套属性(Hash include methods and/or nested attributes)
  • android - 如何避免使用Samsung RFS文件系统延迟/冻结?(android - how to avoid lag/freezes with Samsung RFS filesystem?)
  • TensorFlow:基于索引列表创建新张量(TensorFlow: Create a new tensor based on list of indices)
  • 企业安全培训的各项内容
  • 错误:RPC失败;(error: RPC failed; curl transfer closed with outstanding read data remaining)
  • C#类名中允许哪些字符?(What characters are allowed in C# class name?)
  • NumPy:将int64值存储在np.array中并使用dtype float64并将其转换回整数是否安全?(NumPy: Is it safe to store an int64 value in an np.array with dtype float64 and later convert it back to integer?)
  • 注销后如何隐藏导航portlet?(How to hide navigation portlet after logout?)
  • 将多个行和可变行移动到列(moving multiple and variable rows to columns)
  • 提交表单时忽略基础href,而不使用Javascript(ignore base href when submitting form, without using Javascript)
  • 对setOnInfoWindowClickListener的意图(Intent on setOnInfoWindowClickListener)
  • Angular $资源不会改变方法(Angular $resource doesn't change method)
  • 在Angular 5中不是一个函数(is not a function in Angular 5)
  • 如何配置Composite C1以将.m和桌面作为同一站点提供服务(How to configure Composite C1 to serve .m and desktop as the same site)
  • 不适用:悬停在悬停时:在元素之前[复制](Don't apply :hover when hovering on :before element [duplicate])
  • 常见的python rpc和cli接口(Common python rpc and cli interface)
  • Mysql DB单个字段匹配多个其他字段(Mysql DB single field matching to multiple other fields)
  • 产品页面上的Magento Up出售对齐问题(Magento Up sell alignment issue on the products page)