我有通用(所有数据都将在 javascript/jquery 函数中加载)列表。
功能:
var contentarticles = articles.contentarticles,
article,
$out = $("#articlesOutput");
contentarticlesAll = contentarticles;
for (var i = 0; i < contentarticles.length; i++) {
if (!article || article.title != contentarticles[i].title) {
article = contentarticles[i];
document.getElementById('articleForNaviTopTitle').innerHTML = contentarticles[currentImageNr - 1].title;
document.getElementById('articleForNaviTopStepNr').innerHTML = currentImageNr;
var articlesOutput = [
'<li><a href="./certifiedTraining.html?step=', i + 1, '">',
article.title,
'</li>'
].join("");
$out.append(articlesOutput);
}
}
看起来像:
1. step 1
2. step 2
3. step 3
但我想在其中添加一些静态链接。这样做:
<ul id="articlesOutput">
<li> <a href="./certifiedTraining.html?step=fragenkatalog">Fragenkatalog</a></li>
</ul>
及其我的输出:
1. Fragenkatalog
2. step 1
3. step 2
4. step 3
如何将静态条目作为最后一个,像这样?
1. step 1
2. step 2
3. step 3
4. Fragenkatalog