If I have a piece of JavaScript that is inside of an file called index.html how can I dynamically retrieve the name of the file (index.html)?

I've experimented with document.location and such, but the problem with that is that if the user visits http://www.domain.com/ instead of http://www.domain.com/index.html then document.location wont return the index.html portion.

Is it even possible for JS to access the filename that it exists inside of?