i working ajax/jquery reload division of page after clicking on tab, when running code new jsp displaying...
jsp page
<ul class="nav nav-tabs tabs-up" id="friends"> <li><a href="/area" data-target="#contacts" class="media_node active span" id="contacts_tab" data-toggle="tabajax" rel="tooltip"> contacts </a></li> <li><a href="/gh/gist/response.html/3843301/" data-target="#friends_list" class="media_node span" id="friends_list_tab" data-toggle="tabajax" rel="tooltip"> friends list</a></li> <li><a href="/gh/gist/response.html/3843306/" data-target="#awaiting_request" class="media_node span" id="awaiting_request_tab" data-toggle="tabajax" rel="tooltip">awaiting request</a></li> </ul> <div class="tab-content"> <div class="tab-pane active" id="area"> <%@ include file="areas.jsp" %> </div> <div class="tab-pane" id="friends_list"> </div> <div class="tab-pane urlbox span8" id="awaiting_request"> </div> </div> ajax call
$('[data-toggle="tabajax"]').click(function(e) { var $this = $(this), loadurl = $this.attr('href'), targ = $this.attr('data-target'); $.get(loadurl, function(data) { $(targ).html(data); }); $this.tab('show'); return false; }); controller
@requestmapping("/area") public modelandview noticesajaxrequest(modelmap model) { string str="a"; return new modelandview("areas", "str", str); } but when running code getting areas.jsp output.
the problem still have href attributes in <a> elements.
change <a href="/area" ...
to <a href="" ...
you have store link in attribute (e.g. data-href), then.
Comments
Post a Comment