Its like My current url address is
http://localhost/foldername/index.php
and i wanna show this as http://localhost/foldername is it possible with jquery/JS without using .htaccess
There are two parts to making a pretty URL:
JS can help with (1), because it can see the current URL, and send the browser somewhere else.
For (2), though, you need something on the server-side, because when the browser requests http://localhost/categoryname, the server needs to know what to send it.
This is what mod_rewrite is for. Note that .htaccess is just a file you can put Apache configuration in, not the name of the configuration itself; it's commonly used on shared hosts where you don't have access to the core Apache config.
mod_rewrite can be complicated, but it doesn't need to be. Don't be scared, and don't try to find an exotic workaround which will end up more complicated than modifying a few examples of RewriteRule found online. :)