I need part of the page to be changed dynamically with ajax

前端 未结 2 955
忘掉有多难
忘掉有多难 2020-12-21 10:18

I just finished wireframing and need to dynamically change main part of the page which is a div class=\"container\" with sliced parts of the page which represent other conte

2条回答
  •  Happy的楠姐
    2020-12-21 10:47

    this error Uncaught SyntaxError: Unexpected end of input happens propably due to missing a closing parenthesis. So in your jquery click function, outer closing parenthesis will be missing. I have examined your code and yes you are missing closing paranthesis.

    Also this error related answer is alreday here:JavaScript error (Uncaught SyntaxError: Unexpected end of input)

    $(function () { $(".branding").click(function () {
                        $.ajax({
                            url: 'branding.html',
                            data: { id: $(this).attr('id') },
                            cache: false,
                            success: function (data) {
                                $(".container").replaceWith(data);  //try with double qoutes
                            }
                        });
                    });
                    });//this is the missing paranthesis
    
    
    $(function () { $(".3d").click(function () {
                            $.ajax({
                                url: '3d.html',
                                data: { id: $(this).attr('id') },
                                cache: false,
                                success: function (data) {
                                    $(".container").replaceWith(data);  //try with double qoutes
                                }
                            });
                        });
                        });//this is the missing paranthesis
    

提交回复
热议问题