weixin_33674976 2018-04-13 22:12 采纳率: 0%
浏览 38

ajax只工作一次jquery

i trying to get in a paginator diferent data, but the ajax call only works in the first time, the following code is my code, i try to set cache: false, but it doesn't work

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>jQuery Pagination plugin</title>
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.4/css/bootstrap.min.css" integrity="sha384-2hfp1SzUoho7/TsGGGDaFdsuuDL0LX2hnUp6VkX3CUQ2K4K+xjboZdsXyp4oUHZj" crossorigin="anonymous">
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.0.0/jquery.min.js" integrity="sha384-THPy051/pYDQGanwU6poAc/hOdQxjnOEXzbT+OuUAFqNqFjL+4IGLBgCJC3ZOShY" crossorigin="anonymous"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/tether/1.2.0/js/tether.min.js" integrity="sha384-Plbmg8JY28KFelvJVai01l8WyZzrYWG825m+cZ0eDDS1f7d/js6ikvy1+X+guPIB" crossorigin="anonymous"></script>
    <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.4/js/bootstrap.min.js" integrity="sha384-VjEeINv9OSwtWFLAtmc4JCtEJXXBub00gtSnszmspDLCtC0I4z4nqz7rEFbIZLLU" crossorigin="anonymous"></script>
    <script src="jquery.twbsPagination.js" type="text/javascript"></script>

</head>
<body>
<div class="container">
    <div id="div_Relacion_contactosCris"></div>
    <nav aria-label="Page navigation">
        <ul class="pagination" id="pagination"></ul>
    </nav>
</div>
<script type="text/javascript">
    $(function () {
        var obj = $('#pagination').twbsPagination({
            totalPages: 35,
            visiblePages: 10,
            onPageClick: function (event, page) {
                console.info();
                alert(page)
               // VerRelacionContactos(page);
                $.ajax({
                    type: "POST",
                    dataType: "html",
                    cache: true,
                    url: "Procesos/relacionContactosCliente.asp?CveEmp=EMP5264&Propietario=INEDVE011&Donde=Cliente&IdC=25809&NombreComercial=EMPRESA%20MARTHA&pagina=1",
                    data: "",

                    beforeSend: function (objeto) {
                        $("#div_Relacion_contactosCris").empty();
                        $("#div_Relacion_contactosCris").html('<div align="center"><img src="imageSys/loader.gif"></div>');
                    },
                    success: function (datos) {
                        $("#div_Relacion_contactosCris").empty();
                        $("#div_Relacion_contactosCris").html(datos);
                    },
                    complete: function (objeto, exito) {
                    },
                    error: function (objeto, quepaso, otroobj) {
                        $("#div_Relacion_contactosCris").html("<h1>Favor de contactar al administrador</h1>");
                    }
                });
            }
        });
    });
</script>
</body>
</html>

when start the page, the call works fine, but when i click in another page the ajax call make this error

uncaught TypeError: $.ajax is not a function

who can be the problem?

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 关于#python#的问题:求帮写python代码
    • ¥15 LiBeAs的带隙等于0.997eV,计算阴离子的N和P
    • ¥15 关于#windows#的问题:怎么用WIN 11系统的电脑 克隆WIN NT3.51-4.0系统的硬盘
    • ¥15 来真人,不要ai!matlab有关常微分方程的问题求解决,
    • ¥15 perl MISA分析p3_in脚本出错
    • ¥15 k8s部署jupyterlab,jupyterlab保存不了文件
    • ¥15 ubuntu虚拟机打包apk错误
    • ¥199 rust编程架构设计的方案 有偿
    • ¥15 回答4f系统的像差计算
    • ¥15 java如何提取出pdf里的文字?