Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/69.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/jsp/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Jquery jsp没有得到重新包含_Jquery_Jsp - Fatal编程技术网

Jquery jsp没有得到重新包含

Jquery jsp没有得到重新包含,jquery,jsp,Jquery,Jsp,在我的应用程序中,我有一个jsp,其中包括3个jsp文件。在这3个jsp中,我有一个带有按钮的jsp。按下按钮后,我想更改accordion2.jsp的内容。 我所做的是,一旦按下任何按钮,我就会调用一个servlet,该servlet执行逻辑部分。我应该从这个servlet向accordion2.jsp或包含所有jsp的jsp发送请求吗?下面是我使用的脚本以及html摘录 <script type="text/javascript"> $(document).ready(f

在我的应用程序中,我有一个jsp,其中包括3个jsp文件。在这3个jsp中,我有一个带有按钮的jsp。按下按钮后,我想更改accordion2.jsp的内容。
我所做的是,一旦按下任何按钮,我就会调用一个servlet,该servlet执行逻辑部分。我应该从这个servlet向accordion2.jsp或包含所有jsp的jsp发送请求吗?下面是我使用的脚本以及html摘录

<script type="text/javascript">
    $(document).ready(function() {
      // select all the links with class="lnk", when one of them is clicked, get its "href" value
      // load the content from that URL and place it into the tag with id="content"
      $('input.button').click(function() {

        var url = $(this).attr('src');
        alert(url);
        var status= $(this).attr('value');
          alert(status);
          alert(url+"?name="+status);
        $('.accordion2').detach();
        $('.accordion2').load(url+"?name="+status);
        alert("after load");
        return false;
      });
    });
    </script>



    </head>

    <body class="bodybg" >
    <div class="wrapwidth">
        <!--put header here -->
        <%@include file="header.jsp" %>
        <div class="mainbpdy">
            <!--put vetinav here-->
            <%@include file="vetinav.jsp" %>

            <div class="sroolable">

            <%@include file="accordion2.jsp" %>

            </div>
        </div>
        <div class="footer">footer</div>

    </div>
    </body>
    </html>

$(文档).ready(函数(){
//使用class=“lnk”选择所有链接,单击其中一个链接时,获取其“href”值
//从该URL加载内容,并将其放入id为“content”的标记中
$('input.button')。单击(函数(){
var url=$(this.attr('src');
警报(url);
var status=$(this.attr('value');
警报(状态);
警报(url+“?name=“+状态);
$('.accordion2').detach();
$('.accordion2').load(url+“?name=“+状态);
警报(“装载后”);
返回false;
});
});
页脚

如果顶级JSP生成整个页面,则应调用它以再次生成页面。

我应从此servlet向accordion2.JSP或包含所有这些JSP的JSP发送请求吗??你试过什么吗?