This is happening because of this: http://httpd.apache.org/docs/2.0/mod/mod_dir.html#directoryslash
Nohing to do with your javascript, this is pure Apache wizardry.
Of course, as pointed out in other answers, you should add a slash after "add" because "add" is obvisouly a folder, not a file.