Originally posted by Bhuvana Varsini:
I am using javascript which tries to read a file stored in local disk.
Javascript is used for client side scripting. And based on your previous comment i am assuming that you want the file to be opened from the client's disk and not from the server.
In that case, using the window.location would be useless. You need to provide a facility to the user to input the file location (which may be anywhere on his system) unless ofcourse if you are pretty sure that the file does exist on every user's machine at a fixed location. Using localhost:8080
is a server url and not the user's machine.
If you want to load a file which is present on the server itself , you shouldnt be using javascript! Use some server side technology (e.g. Servlets ) to store the file on the server side.
It all depends on what exactly you are planning to do