我正在尝试使用 jquery.formatCurrency-1.4.0.js
和我的 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 .
关于javascript - FormatCurrency 不是函数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33247711/