|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
|
|
Ajax Application Generator Generate database and reporting .NET Web apps in minutes. Quickly create visually stunning, feature-rich apps that are easy to customize and ready to deploy. Download Now!
|
|
#1
|
|||
|
|||
|
saveToTexFile
I am very new to JavaScript and Í'm trying to learn it on my own. I'm currently trying to implement a function that saves a page or table of information to a comma delimited or text delimited textfile but I need help. So far I have the following in one script:
function saveToTextFile() { var Win3 Win3 = window.open("","SaveWindow","scrollbars,resizable,width=650,height=650"); for (var i=0;i < arrRecs.length; i++) { Win3.document.writeln(arrRecs[i]+"<br>"); } Win3.document.writeln('<hr><img src="' + baseURL + 'images/SaveAsInfo.gif"><br>'); Win3.document.writeln('<center><input name=Button onClick=document.all.WebBrowser.ExecWB(4,1) type=button value="Save As"><OBJECT classid=CLSID:8856F961-340A-11D0-A96B-00C04FD705A2 height=0 id=WebBrowser width=0></OBJECT></center>'); Win3.document.close(); In a second script I have the following: <p><font face=Verdana size=1 color="#336699"><b>|<a href="javascript pener.parent.MapFrame.saveToTextFile() ">Save Results to Text File</a>|</p>The hyperlink created above is supposed to execute the function by calling another window that has a saveas button. However, I get an error page message when I select my hyperlink. PLEASE HELP!!! |
|
#2
|
|||
|
|||
|
I don't know how to write to a file in JavaScript (I don't think that it is possible due to security concerns in the browser - would you want somebody you don't know writing to your hard drive?
).However, it is really easy to do it PHP (or ASP). Here's a PHP example: PHP Code:
Check out www.php.net or the articles @ www.devarticles.com |
|
#3
|
|||
|
|||
|
Hi pentapenguin:
I appreciate your response to my inquiry. For clarification purposes, allow me to explain that it was not my intention to allow a browser user to write to my desktop. What I would like to do is have the user write the contents of a frame to THEIR own desktop in a texfile format. Nevertheless, I will investigate the PHP solutions you suggested. once again, thanks. |
![]() |
| Viewing: Dev Articles Community Forums > Programming > JavaScript Development > saveToTexFile |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|