What is the Javascript code that you insert into the address bar that lists all the pages on a website?

This is not possible with javascript.

What you are most likely referring to is a list generated by a web server. It is possible to "crawl" links using a server side language, like PHP.