vue和jQuery嵌套实现异步ajax通信

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>vue和jQuery嵌套实现异步ajax通信</title>
    <script src="../js/jquery.min.js"></script>
    <script src="../js/vue.js"></script>
    <script>
        // 可以兼容jQuery和vue的单一入口
        window.onload = function(){
            var app = new Vue({
                el:"#app",
                // vue内置属性用来绑定事件
                methods:{
                    get:function(){
                        // 发送get请求
                        $.ajax({
                            // 指定请求方式
                            type:"GET",
                            // 网址,ajax.php特制的服务器端请求
                            url:"http://192.168.1.238/ajax.php",
                            // 数据格式,jsonp是一种跨域请求的格式
                            dataType:"jsonp",
                            // 回调函数
                            jsonp:"callback",
                            // 通信成功后,打印服务器端返回的数据
                            success:function(msg){
                                // alert(msg.text);
                                // 使用jQuery实时渲染页面(改变div盒子)的内容
                                $("#message").html("下午好,您已成功登录!")
                            }
                        });
                    }
原文地址:https://www.cnblogs.com/lutt/p/10427553.html