Question : Downloading File through java script on client browser!

Hi experts...

Hope you all are doing good !!!

Well, I am newbie to this java script coding. I need to implement file download functionality through java script in my xhtml page.

Below is the script written:
1:
2:
3:
4:
5:
		    function jsexportXLS(){
			    alert("about to download...");
		    	window.open("D:\Shashi\MyFile.xls");
		    	alert("window opened...");
			}


I am able to see alert message before opening new window. But after that I see in java script error in my browser (IE). error is "Access is denied".
But I clearly see there is no restrictions on my excel page.

Can any one help me any other way to download a file through java script if I am wrong in above?
Also when we say the file name, does it append to end of url ? I guess it should be like that...  Any help is appreciated...

Cheers,
yarabati

Answer : Downloading File through java script on client browser!

One more thing,

If you create the folder tests on your localhost server and copy the html source file and the xsl file in that folder, the url would be: http://localhost/tests/index.html (or whatever the file name . html)

An alias to the localhost is the IP: 127.0.0.1 -> http://127.0.0.1/tests/index.html
Random Solutions  
 
programming4us programming4us