FormatCurrency 不是函数
FormatCurrency is not a function
我正在尝试使用 jquery.formatCurrency-1.4.0.js
将 onblur 事件上的文本框值转换为 $
货币,我的 javascript 函数如下所示:
$(document).ready(function()
{
$('.currency').blur(function()
{
$('.currency').formatCurrency();
});
});
Html:
<input type="textbox" id="currencyField" class="form-control currency" placeholder="Enter Price"/>
有人能帮帮我吗?
我认为您的代码工作正常,您只需添加 jquery-formatcurrency
库 :
https://jquery-formatcurrency.googlecode.com/files/jquery.formatCurrency-1.4.0.min.js
或者下载它会更好因为 googlecode.com 正在被弃用 就像下面评论中提到的@charliefl。
参见 fiddle HERE 中的实现。
我正在尝试使用 jquery.formatCurrency-1.4.0.js
将 onblur 事件上的文本框值转换为 $
货币,我的 javascript 函数如下所示:
$(document).ready(function()
{
$('.currency').blur(function()
{
$('.currency').formatCurrency();
});
});
Html:
<input type="textbox" id="currencyField" class="form-control currency" placeholder="Enter Price"/>
有人能帮帮我吗?
我认为您的代码工作正常,您只需添加 jquery-formatcurrency
库 :
https://jquery-formatcurrency.googlecode.com/files/jquery.formatCurrency-1.4.0.min.js
或者下载它会更好因为 googlecode.com 正在被弃用 就像下面评论中提到的@charliefl。
参见 fiddle HERE 中的实现。