Hi All!
I am using Javascript to export some content in a popup (in this case, just 5 simple words) to a text file. This works fine and the user can save the text file.
Upon opening the file, it appears to be just a basic text file, however, i encounterd a problem importing this into flash (thats another story!). The text file needs to consist of just a line of text for the import (ie. word1=hello&word2=world), this is how it appears in notepad. But, when opened in a hex editor, it shows that there are stops inbetween every letter/number! (w.o.r.d.1.=.h.e.l.l.o.&.w.o.r.d.2.=.w.o.r.l.d) These are represented as 00 in hex...
I think this may be a problem with my javascript as i am fairly new to the language.
Any help would be greatly appreciated!
Cheers.
Gav
4 4185
Post the code you have used.
Heres the Javascript code im using - <script language=JavaScript>
-
-
function test() {
-
output = window.open("", "output", "width=600, height=600, toolbar=no, titlebar=no, location=no, directories=no, status=no, menubar=yes, scrollbars=no, resizable=no, copyhistory=no,");
-
-
output.document.write("word0="+word1_txt.value+"&"+"word1="+word2_txt.value+"&"+"word2="+word3_txt.value+"&"+"word3="+word4_txt.value+"&"+"word4="+word5_txt.value);
-
-
output.document.execCommand("SaveAs",false,"*.txt")
-
-
output.close();
-
-
}
-
-
</script>
The word1_txt.value are needed for the users input on the main page.
I have recently discovered that i can save as a .doc file and the problem goes, this is ok for a temporary solution however, if it is possible i would rather use .txt.
Cheers
See this link. Read the section on null bytes.
Great! This looks like the kind of thing im after! Ill have a go at integrating this with what i've done at the moment.
Thanks for the help!
Gav
Sign in to post your reply or Sign up for a free account.
Similar topics
by: lir |
last post by:
Hi,
I am trying to save a fram in a page using the execCommand("saveas")
the html is save currectly but I can not save the gif on that page.
How can I save the fram with the gif via...
|
by: comshiva |
last post by:
Hi all,
I have converted my existing ASP.NET project from 1.1 to 2.0 and i have
found that everything works fine except the linkbutton control in my
datagrid which throws an javascript error when...
|
by: Ian Davies |
last post by:
Hello
I have the following sql string to run as a command in my VB6 project to
update mysql table
strSQL = "LOAD DATA INFILE " & ImportFile & " INTO TABLE tPupils FIELDS
TERMINATED BY ','...
|
by: psanjay |
last post by:
Hi,
Am unable to open javascript SaveAs dialog box in Firefox browser. Following is the script,
<a href="javascript:void(0);" onclick="document.execCommand('SaveAs',false,'*.xyz');">Save this...
|
by: Coldfire |
last post by:
Hello,
The issue is: I have a webpage that displays image in img tag while taking its src from a remote url ( dynamically). Now, my client want this functionality to ask for "Save at any location"...
|
by: mrobinson86 |
last post by:
Hey guys, wondered if anybody could help me out with a pretty simple piece of code that has been driving me crazy for the past few days?
I am trying to create a client side self sustaining message...
|
by: =?Utf-8?B?U2NvdHQgVHJpY2s=?= |
last post by:
I followed the instructions from MSDN for Webclient UploadFile and I get an
error: Could not find file 'C:\testfile.xls'.
If I add the file (c:\testfile.xls) to the server I do not get the error...
|
by: James Lucero |
last post by:
Below is my code. The error is "Compile Error Variable not defined". wdOrientLandscape is highlighted. Again this the portion of the code from a VB module created in Excel. The previous lines of code...
|
by: taylorcarr |
last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: aa123db |
last post by:
Variable and constants
Use var or let for variables and const fror constants.
Var foo ='bar';
Let foo ='bar';const baz ='bar';
Functions
function $name$ ($parameters$) {
}
...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
| | |