大家下午好
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
<script type="text/javascript" src="{{ asset('bundles/reflorestasite/js/jquery.maskedinput.min.js') }}"></script>
<script type="text/javascript" src="{{ asset('bundles/reflorestasite/js/validacoes.js') }}"></script>
<script type="text/javascript" src="{{ asset_url }}"></script>
Run Code Online (Sandbox Code Playgroud)
在"validacoes.js"文件中有
$(document).ready(function(){
$(".cpf").mask("999.999.999-99");
$('.cpf').blur(function () {
var id=$(this).attr("id");
var val=$(this).val();
var pattern = new RegExp(/[0-9]{3}[\.]?[0-9]{3}[\.]?[0-9]{3}[-]?[0-9]{2}/);
if(val.match(pattern) == null){
$("#"+id+"_error").html("Digite um CPF válido");
}
});
});
Run Code Online (Sandbox Code Playgroud)
我已经在控制台验证了所有的javascript文件.但是我收到错误"Uncaught TypeError:$(...).mask不是函数"
有没有人知道为什么symfony没有识别maskedinput插件?
非常感谢你.