Batman leaves the Joker dangling from the building ledge, and as he leaves, you see SWAT team members getting ready to apprehend him from there.
So it does end with him getting captured. Although as easily as he evades a tight spot, I'm sure they would have a sequel in the works.
(Would have. )
Yes, this is what I mean. I do recall the last we see of the Joker is him dangling there. But, you're absolutely right that the Joker has proven himself capable of getting out to tight spots all the time and he can easily get out of prison, etc. The fact that we don't see him killed or even arrested I think is meant to make his fate extremely ambiguous and open ended.
It's something I've never quite understood about Batman's villains particularly (and maybe it's explained in the comic books, etc. and I'm just not aware). But, his villains seem to always be capable of coming back. So, we have here the second manifestation of the Joker.
Did any of you re-watch the Jack Nicholson Batman/Joker movie in preparation for TDK? I watched it years ago when it first came out (and I really like that one too, I recall). But, it's been so long since I've seen it I don't really remember the details or even the plot of that one. It would be really interesting to compare those two Batman films in-depth.