JQuery冲突(可能?)隐藏/显示基于Radio Box的Div(JQuery conflict (maybe?) Hide/Show Div based on Radio Box)
这真让我抓狂。 我尝试了各种不同的方法来做到这一点。 试图根据收音机选择显示/配置div。 下面是我的main.js代码:
$("input[name='payment_method']").click(function () { if ($(this).attr("id") == "payment_method_cod") { $("#checkout_insurance").show(); } else { $("#checkout_insurance").hide(); } });
HTML:
<div id="checkout_insurance"> <h2>Checkout with Insurance</h2> </div> <div id="payment" class="woocommerce-checkout-payment"> <ul class="payment_methods methods"> <li class="payment_method_cod"> <input id="payment_method_cod" type="radio" class="input-radio" name="payment_method" value="cod" data-order_button_text="" checked="checked"> <label for="payment_method_cod"> ... </li> <li class="payment_method_firstdata"> <input id="payment_method_firstdata" type="radio" class="input-radio" name="payment_method" value="firstdata" data-order_button_text=""> <label for="payment_method_firstdata"> .... </li> </ul> </div>
我不能上班。 如果我在页脚上放置另一个jQuery的cdn,该函数可以正常工作,但会搞砸很多其他东西。 jQuery正在加载标题。 我目前正在使用jQuery 1.11.3。
任何帮助将不胜感激。 谢谢!
This is driving me crazy. I have tried every different ways to do this. Trying to show/hive a div based on a radio box selection. Below is my code into my main.js :
$("input[name='payment_method']").click(function () { if ($(this).attr("id") == "payment_method_cod") { $("#checkout_insurance").show(); } else { $("#checkout_insurance").hide(); } });
HTML:
<div id="checkout_insurance"> <h2>Checkout with Insurance</h2> </div> <div id="payment" class="woocommerce-checkout-payment"> <ul class="payment_methods methods"> <li class="payment_method_cod"> <input id="payment_method_cod" type="radio" class="input-radio" name="payment_method" value="cod" data-order_button_text="" checked="checked"> <label for="payment_method_cod"> ... </li> <li class="payment_method_firstdata"> <input id="payment_method_firstdata" type="radio" class="input-radio" name="payment_method" value="firstdata" data-order_button_text=""> <label for="payment_method_firstdata"> .... </li> </ul> </div>
I cant get to work. If I place another cdn of the jQuery on the footer, the function works, however messes up a lot of other stuff. jQuery is being loaded on the header. I am current using jQuery 1.11.3.
Any help will be appreciated. Thank you!
原文:https://stackoverflow.com/questions/33096588
最满意答案
解决方案结果非常简单。 我只需要在命令行中添加
/p:Password=<insert password here>
作为参数。 我在publish
向导中提供了密码,但出于安全考虑,它不存储在.pubxml
文件中。实际上我是从
SAYED IBRAHIM HASHIMI
的“补充”一书中SAYED IBRAHIM HASHIMI
。 这本书的标题是Microsoft Build Engine内部的补充 。The solution turned out to be very simple. I simply needed to add
/p:Password=<insert password here>
as a parameter on the command line. I supplied the password in thepublish
wizard, but for security purposes this isn't stored in the.pubxml
file.Actually I discovered this from a 'supplement' book by
SAYED IBRAHIM HASHIMI
. The book is titled Supplement to Inside the Microsoft Build Engine.
相关问答
更多-
它正在工作! 这就是我所做的: 遵循这里的建议: 删除了键: [HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers] 。 VS2012加载,但然后崩溃之前,我可以做任何事情(错误在C:\Windows\syswow64\KERNELBASE.dll ) 然后我删除了: [HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\11.0] [HKEY ...
-
解决方案结果非常简单。 我只需要在命令行中添加/p:Password=
作为参数。 我在publish向导中提供了密码,但出于安全考虑,它不存储在.pubxml文件中。 实际上我是从SAYED IBRAHIM HASHIMI的“补充”一书中SAYED IBRAHIM HASHIMI 。 这本书的标题是Microsoft Build Engine内部的补充 。 The solution turned out to be very simple. I simply ne ... -
仅供参考:Microsoft在VS 2012更新#2中增加了该功能: http://www.west-wind.com/weblog/posts/2013/May/10/Publish-Individual-Files-to-your-Server-in-Visual-Studio-20122 Just FYI: Microsoft added that feature in VS 2012 Update #2 : http://www.west-wind.com/weblog/posts/2013/May ...
-
Microsoft Visual Studio 2012非常小的命令行(Microsoft Visual Studio 2012 very small command line)[2024-01-14]
右键单击窗口顶部并选择“默认值”,编辑大小设置,再次保存并加载命令窗口 Right click on the top of the window and choose 'Defaults', edit the size settings, save and load the command window again -
visual studio 2012多个命令的命令行参数(visual studio 2012 multiple -commands in command line arguments)[2022-03-22]
如果您首先需要add-pssnapin Registerv2.0 ,然后再调用New-Token ,则应该将它们链接到一个命令中,如下所示: -command "add-pssnapin Registerv2.0; New-Token" 如果New-Token需要一个参数,则应直接在命令行上传递它,而不是尝试模拟用户输入。 例如, New-Item会预期一系列路径和一个类型作为输入,两者都可以作为参数在命令行中提供。 像这样: New-Item foo -type directory 那么,如何将www ... -
导航到您的程序菜单> Microsoft Visual Studio 2005> Visual Studio工具> Visual Studio 2005命令提示符 。 此命令提示符具有为命令行会话设置的所有必需的.NET环境变量。 您可以将目录更改为解决方案目录并运行: Msbuild.exe mySolution.sln 用于检查下面的VS 2010中的代码: tf checkin 对于VS 2013/2015: https://www.visualstudio.com/en-us/docs/tfvc ...
-
这是我想出的一个解决方法,因为我需要继续前进。 这不是很好,但它让我得到了CI所需要的东西。 为解决此问题,我从常规解决方案配置中排除了所有报表项目,并添加了仅构建报表项目的新ReportOnly配置。 然后在我的CI服务器上,我针对Visual Studio 2012构建非报告配置,并针对Visual Studio 2010构建ReportOnly配置。 可以在Microsoft Connect票证中找到最新的对话和其他解决方法(如果已发现)。 Here is a workaround that I ca ...
-
正如其他人所指出的那样,这是因为msbuild不在你的道路上。 你有两个选择: 将msbuild的路径添加到PATH环境变量中 应该有一个“开发人员命令提示符”和快递一起安装。 这将已经设置了所有必需的路径,因此您可以使用msbuild和任何其他工具。 As others have pointed out, it was because msbuild is not on your path. You have two options: Add the path to msbuild to the PATH ...
-
您的命令行需要看起来像这样: msdev myworkspace.dsw /MAKE "myproject - Win32 Release" /OUT buildlog.txt 您还需要将开发环境放在PATH上 - 如果它尚未存在,则需要运行c:\Program Files\Microsoft Visual Studio\VC98\Bin\vcvars32.bat或类似命令。 Your command line needs to look something like this: msdev mywork ...
-
要增加内部版本号,我在.csproj文件中使用MSBuild扩展包 ,如下所示:
相关文章
更多- jquery1.4.4的radio选中项
- jquery 效果实现,div失去焦点
- Java-based 实现的索引复制
- gwt 部署在div 中的问题。
- jquery 问题
- Android EditText软键盘显示隐藏以及“监听”
- div 与 iframe页面缩小问题 [JavaScript]
- 如何用正则表达示匹配一个div标签
- div布局代替frame布局后该如何跳转呢?
- 《DIV.CSS应用视频教程》(DIV+CSS)[压缩包]
最新问答
更多- 您如何使用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)