<div id="cat"></div>
<script>
$("#cat").html(location.pathname);
</script>
I think that example would work, but anyway, if location.pathname has to be a valid page, can this be exploited?
Edit: I'm mainly talking about if the user can't make up their own pathname, (i.e. /test/<script>alert(0)</script>
).