且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Laravel @通过Ajax包含刀片视图

更新时间:2021-10-12 22:57:56

您想要

$(document).ready(function() {
    $("#tab1").click(function() {
        $.ajax({
            type: 'POST', 
            url : "/yourrouteview", 
            success : function (data) {
                $("#tab1").html(data);
            }
        });
    });
}); 

您的控制器和路由必须配置/yourrouteview以获得正确的视图(即@include('price.blade.php')

Your controller and route must configure /yourrouteview to get the correct view (that is @include('price.blade.php')