jQuery(function () { // showContent($(".tabbar .active").attr("data-url")); }); function showContent(url) { $.ajax({ url: contextPath + url, dataType: "html", success: function(response, status, xhr) { $(".content").html(response); } }); }