473,320 Members | 1,825 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Save page into file

I have desgined script to show div at runtime. Now I want to copy that
newly created div and/or to save in normal html file so that i can see
later.

1. When I select all the content or view its source, it does not shows
the newly created div.
2. My script is working in IE but not working in Mozilla firefox.
(I want to work in Mozilla, b'cause when we select all the content with
new div and can save with that also.)
3. I want to save this loaded page using javascript.

Please help me, its urgent...!

Prakash

Jul 23 '05 #1
10 15579
ASM
Prakashsir wrote:
3. I want to save this loaded page using javascript.

Please help me, its urgent...!


sorry

you CAN'T save anything by JS

--
Stephane Moriaux et son [moins] vieux Mac
Jul 23 '05 #2
Jc
Prakashsir wrote:
I have desgined script to show div at runtime. Now I want to copy that
newly created div and/or to save in normal html file so that i can see
later.

1. When I select all the content or view its source, it does not shows
the newly created div.
2. My script is working in IE but not working in Mozilla firefox.
(I want to work in Mozilla, b'cause when we select all the content with
new div and can save with that also.)
3. I want to save this loaded page using javascript.

Please help me, its urgent...!

Prakash


I believe you can save the result of script changes to HTML in IE by
changing the "Save as type" to "Web Page, HTML only" from the Save As
option under the File menu.

This should allow you to save your page as an HTML file with the DIV
included.

There are many differences between IE and Mozilla, check out the "W3C
DOM Compatibility Tables" at http://www.quirksmode.org/.

Jul 23 '05 #3
Ivo
"Prakashsir" wrote
I have desgined script to show div at runtime. Now I want to copy that
newly created div and/or to save in normal html file so that i can see
later.

1. When I select all the content or view its source, it does not shows
the newly created div.
2. My script is working in IE but not working in Mozilla firefox.
(I want to work in Mozilla, b'cause when we select all the content with
new div and can save with that also.)
3. I want to save this loaded page using javascript.


There is no standard way to do this, it would really be better to rethink
your needs here, but IE/Win has the execCommand( 'SaveAs' ) to save an
arbitrary string of text (for example the outerHTML of your div or the whole
body) to the user's file system.

See for a demonstration, among others:
<URL: http://4umi.com/web/javascript/filewrite.htm >

WIth an ActiveXobject you would have even some more control over the format
and filename, but that would narrow the user base even further.
hth
ivo
Jul 23 '05 #4
ASM
Ivo wrote:

See for a demonstration, among others:
<URL: http://4umi.com/web/javascript/filewrite.htm >


runtime error :-(

FF on Mac
--
Stephane Moriaux et son [moins] vieux Mac
Jul 23 '05 #5
"ASM" <st*********************@wanadoo.fr> wrote in message
news:42***********************@news.wanadoo.fr...
Ivo wrote:

See for a demonstration, among others:
<URL: http://4umi.com/web/javascript/filewrite.htm >


runtime error :-(

FF on Mac


That method is IE/Win only, and allows you to write either .txt or .html
files only.

--
Dag.
Jul 23 '05 #6
ASM wrote:
Prakashsir wrote:
3. I want to save this loaded page using javascript.

Please help me, its urgent...!

sorry

you CAN'T save anything by JS


No, but you can view/save the modified source. Copy/paste the code
below into the address bar, watch for wrapping it needs to be a single
line without returns:

javascript:CODE=window.open('','CODE','height=700, width=800');
CODE.document.write('<FORM NAME="SPAM"><TEXTAREA NAME="SRC" ROWS=45
COLS=82></TEXTAREA></FORM>');
CODE.document.SPAM.SRC.value=document.documentElem ent.innerHTML;
CODE.document.close();void 0;
Save it as a bookmark if you like!
--
Rob
Jul 23 '05 #7
ASM
RobG wrote:
you can view/save the modified source. Copy/paste the code
below into the address bar, watch for wrapping it needs to be a single
line without returns:

javascript:CODE=window.open('','CODE','height=700, width=800');
CODE.document.write('<FORM NAME="SPAM"><TEXTAREA NAME="SRC" ROWS=45
COLS=82></TEXTAREA></FORM>');
CODE.document.SPAM.SRC.value=document.documentElem ent.innerHTML;
CODE.document.close();void 0;
Save it as a bookmark if you like!


what is : documentElement
or ...
how do you pass this argument to this bookmark ?

--
Stephane Moriaux et son [moins] vieux Mac
Jul 23 '05 #8
Ivo
"ASM" wrote
RobG wrote:
you can view/save the modified source. Copy/paste the code
below into the address bar, watch for wrapping it needs to be a single
line without returns:

javascript:CODE=window.open('','CODE','height=700, width=800');
CODE.document.write('<FORM NAME="SPAM"><TEXTAREA NAME="SRC" ROWS=45
COLS=82></TEXTAREA></FORM>');
CODE.document.SPAM.SRC.value=document.documentElem ent.innerHTML;
CODE.document.close();void 0;
Save it as a bookmark if you like!


what is : documentElement
or ...
how do you pass this argument to this bookmark ?

I believe it is all meant to be on one line. The innerHTML could also be
written directly between writing the textarea tags. documentElement is a
reference to the root node of the document.

This is another 'View Generated Source' bookmarklet, with linenumbers:

javascript:'<code><ol><li>'+(document.documentElem ent||document.body).outerH
TML.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/%20%20/g,"&nbsp;%20"
).replace(/\n/g,"<li>")+'<\/ol><\/code>';

hth
ivo
Jul 23 '05 #9
Ivo wrote:
"ASM" wrote
RobG wrote:
you can view/save the modified source. Copy/paste the code
below into the address bar, watch for wrapping it needs to be a single
line without returns:

javascript:CODE=window.open('','CODE','height=7 00,width=800');
CODE.document.write('<FORM NAME="SPAM"><TEXTAREA NAME="SRC" ROWS=45
COLS=82></TEXTAREA></FORM>');
CODE.document.SPAM.SRC.value=document.documentE lement.innerHTML;
CODE.document.close();void 0;
Save it as a bookmark if you like!


what is : documentElement
or ...
how do you pass this argument to this bookmark ?
To ASM:

create a new bookmark, then edit it. Replace the URL in the bookmark
with the script.


I believe it is all meant to be on one line. The innerHTML could also be
written directly between writing the textarea tags. documentElement is a
reference to the root node of the document.

This is another 'View Generated Source' bookmarklet, with linenumbers:

javascript:'<code><ol><li>'+(document.documentElem ent||document.body).outerH
TML.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/%20%20/g,"&nbsp;%20"
).replace(/\n/g,"<li>")+'<\/ol><\/code>';


The use of outerHTML makes it less browser-friendly - but it works in
IE 5.2 where the one I posted didn't.

--
Rob
Jul 23 '05 #10
alu

"Dag Sunde" wrote
"ASM" wrote
Ivo wrote:

See for a demonstration, among others:
<URL: http://4umi.com/web/javascript/filewrite.htm >


runtime error :-(

FF on Mac


That method is IE/Win only, and allows you to write either .txt or .html
files only.

--
Dag.

You could try writing
document.body.innerHTML
into a new window and printing from there. Seems to work in IE/Win &
Firefox.
-alu
Jul 23 '05 #11

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: a | last post by:
Save text file as html kloepper 17:42 23 Jul '04 I'm using httpwebresponse and a StringBuilder to return a stream that originates as a file with the .txt suffix (My download code converts the html...
4
by: Mr Gordonz | last post by:
Hi All, I want to be able to save a file from the client's PC on the server. The tricky part is the aspx page is never actually seen by the user. Basically, I have a VB application running on...
6
by: jake | last post by:
How do you get or save a file from/to a client (button on web page) once they are authenticated? The client could be Mac, Linux or Windows. Can I do it all with IIS and ASP.NET?
8
by: DanB | last post by:
This is probably soooo simple but I can't seem to get it. I have a text file that I want users to download via a web page. I want the file to be saved to a default folder (or one that they...
5
by: Patrick | last post by:
Following on from the excellent example at http://www.c-sharpcorner.com/Code/2003/Sept/ExportASPNetDataGridToExcel.asp on how to save a data-grid to excel file, how can I extend the example such...
3
by: needin4mation | last post by:
I have data I am reading from a database. I want to take that data, parse it, and put it in between html tags. When I have that row completed in between all the tags, then I want to save that...
4
by: Matt | last post by:
Hi, I would like to save a file locally (on the client computer) in an ASP.net application. It is like the server would return some data that the user can save to a file on his local PC. The ASP...
5
by: cfps.Christian | last post by:
Is there a way to tell a process to specifically use the page file for object storage? Our problem is we are loading objects that need to be stored during application runtime but not actually...
1
by: jelenalug | last post by:
silly question.... where should I save XML file with info of coordinates for markers ... i tried everything... nothing works. 'm trying to create a map same as on this link : ...
1
by: krndhi1983 | last post by:
Dear all, I am using firefox in RedHat Linux and I want to remove the option "Save Page As" from File Menu.I am using the code as belows in userChrome.css. I can remove all the...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.