473,778 Members | 1,953 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 15617
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************ *********@wanad oo.fr> wrote in message
news:42******** *************** @news.wanadoo.f r...
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.w rite('<FORM NAME="SPAM"><TE XTAREA NAME="SRC" ROWS=45
COLS=82></TEXTAREA></FORM>');
CODE.document.S PAM.SRC.value=d ocument.documen tElement.innerH TML;
CODE.document.c lose();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.w rite('<FORM NAME="SPAM"><TE XTAREA NAME="SRC" ROWS=45
COLS=82></TEXTAREA></FORM>');
CODE.document.S PAM.SRC.value=d ocument.documen tElement.innerH TML;
CODE.document.c lose();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.w rite('<FORM NAME="SPAM"><TE XTAREA NAME="SRC" ROWS=45
COLS=82></TEXTAREA></FORM>');
CODE.document.S PAM.SRC.value=d ocument.documen tElement.innerH TML;
CODE.document.c lose();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:'<co de><ol><li>'+(d ocument.documen tElement||docum ent.body).outer H
TML.replace(/&/g,"&amp;").repl ace(/</g,"&lt;").repla ce(/%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:C ODE=window.open ('','CODE','hei ght=700,width=8 00');
CODE.documen t.write('<FORM NAME="SPAM"><TE XTAREA NAME="SRC" ROWS=45
COLS=82></TEXTAREA></FORM>');
CODE.documen t.SPAM.SRC.valu e=document.docu mentElement.inn erHTML;
CODE.documen t.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:'<co de><ol><li>'+(d ocument.documen tElement||docum ent.body).outer H
TML.replace(/&/g,"&amp;").repl ace(/</g,"&lt;").repla ce(/%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

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

Similar topics

0
6437
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 tags in this text file to well formed XHTML tags). The contents of the file contain html tags and the data in those tags. eg., <table cellSpacing=0 cellPadding=0 width="100%" align=center border=0> <TBODY> <tr> <td width="48%"></td> <td...
4
1673
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 the client PC, it calls an aspx page and passes some data as query srtings, including the full path to the relevant file(s) on the client PC. For example, the VB app might call the page thus: ...
6
1795
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
2699
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 choose) on the users / client file system. I have toyed with a Self-Extracting zip file but the contents of my zip file changes each time it is downloaded so that invalidates the exe file. Also the text file is so small it is a waste to zip it.
5
3508
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 that when the user click on the button a popup appear in IE to say "Do you want to save or open file?"
3
1367
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 file as an .htm. I'm not asking anyone to write code. I was hoping someone would point me in the right direction or where I should start on the file save part. I can read a database and display the contents. I just don't
4
2577
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 page has a text field to type in the file path directly and a "Browse..." button, that shall display a "Save as..." dialog. I tried with the FileUpload control, but this does not work, since I do not want to upload an existing file, but I want to...
5
2526
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 saved until told to do so. In our case these objects can easily eat 300+ MB of memory. Unfortunately we can't save any of the images until the overall project is saved so we don't have the luxury of the local drive for temp storage.
1
914
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 : http://econym.googlepages.com/categories.htm
1
3261
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 options. but i unable to remove the Save Page As option. Any one can solve this, kindly post ur suggestion. Code: #urlbar,#searchbar { display:none; }navigator-toolbox {
0
9629
marktang
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10296
Oralloy
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10127
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10068
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
6723
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5370
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5497
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4031
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2863
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.