所以我有一个站点URL字符串循环的例子,并试图添加页面到链接,但我不想处理该域名,因为它是固定的。现在它不起作用..但我试图修复它。网站地图JQuery风格..使用attr。加页网址
<script>
$(document).ready(function() {
url = $(this).attr('href', $(this).attr('href'));
$('#sitemap a').attr('href','http://site.com/?c=123&p='+url);
});
</script>
// trying to get output http://site.com/?c=123&p=page1.html
<div id="sitemap">
<a href="page1.html">test</a>
<a href="page2.html">test</a>
<a href="page3.html">test</a>
</div>
_ How does not work it?解释你有什么问题,并且你可能会得到答案。 – Bojangles
我正在尝试获取#sitemap – Blynn