can any body tell me how i create a .txt file using javascript which is browser compatable too.
and after creating the file it gives the save as diaglog box so that
For a great example of how to do this, look at TiddlyWiki which implements a single user wiki in Javascript. It supports all the major browsers and in each will save a copy of itself to the local disk.
It uses the FileSystemObject in IE (as described previously in this question) The best info for file saves in FireFox is https://developer.mozilla.org/en/Code_snippets/File_I%2F%2FO
For Chrome, Opera & Safari is uses a little applet:
The TiddlySaver Java applet allows TiddlyWiki to save changes in a local version (from a file:// URL) of Safari, Opera and other browsers.