Ajax不是一个功能

问题描述 投票:0回答:1

当我在输入类型上键入内容时,我的jQuery遇到了这个问题。

有我的js:

$(document).ready(function(){
    $("#cif").keyup(function(){
        var name = document.getElementById("cif").value;

        console.info(name);

        $.ajax({
            type: 'post',
            url: '<?php echo site_url(); ?>register/cif',
            dataType: 'json',
            data: {
                cif:name,
            },
            success: function (response) {
                $('#raosocial').html(response);
                if(response=="OK"){
                    return true;    
                }
                else{
                    return false;   
                }
            }
        });
    });
});

我试过没有$ .ajax,但出现了语法错误

javascript jquery ajax codeigniter
1个回答
0
投票

确保你没有使用不包含$.ajax()的超薄版本的jQuery。下载完整的jQuery here

© www.soinside.com 2019 - 2024. All rights reserved.