I've been searching for the last day and can't find anything on this specific topic asked within the last year or two, and as JQuery appears to deprecate things quite a lot, it seems fair to ask this question with regard to the current JQuery API.
Bit new to JQuery, I'd like to know this;
If I have a tab for every member of a team, and for each of those tabs a table of data is loaded in a partial view from a database, when I load the initial page will all the tabs be populated with their partials or will they only be populated when the tab is clicked?
If the tabs are populated on page load, is there a way to make it so that the tabs only populate when clicked? I can provide the source code if there's any point in doing so, just comment and ask for it.
EDIT 1
As I'm using ASP.NET MVC to render the partial views with contextual information, is it literally just the "ajax/" that is important in the href or does the href need to link to static content? Question regards:
<div class="h-single" id="users">
<ul>
@{
foreach (var user in Model)
{
<li><a href="ajax/"[email protected]><span>@user.Name</span></a></li>
}
}
</ul>
@{
foreach (var user in Model)
{
<div [email protected]>@Html.Action("_userAdvisoryRequests", new { username = user.EHLogin })
</div>
}
}
</div>
Just noticed you don't need the divs for ajax content so that ain't gonna work either.
EDIT 2
Solution:
<div class="h-single" id="users">
<ul>
@{
foreach (var user in Model)
{
<li><a [email protected]("_partial","Home", new { param = @user.Param })><span>@user.Name</span></a></li>
}
}
</ul>
</div>
Credits to Ashwini Verma for the answer!
"If the href in the <li><a> tag references a div then the div must be page-loaded in order to be viewed, but if the href references an action or a link then it can be loaded on demand."