473,396 Members | 1,853 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,396 software developers and data experts.

Capturing the content/state of the HTML Page along with the changes

Hi...,

We have a pretty huge form where the user/support spends more than
6 minutes. Now, behind the scenes, I wanted to capture the outerHTML
data & send it to a different URL to save it in draft.

Now there is no outerHTML in Firefox. secondly even innerHTML is
different for IE & Firefox as in IE the updates I do to the text field
are now visible in the innerHTML text but the changes are not visible
when I run the javascript in Firefox.

For eg. if there is a Text Box which alreay has value "100" & I change
it to "1000". The innerHTML o/p in IE shows the value "1000" correctly
where as in Firefox it shows "100".

My main intention is to capture the current HTML state (along with the
changes) and post it to a different URL while the user is filling the
current form.

How do I achieve it,?

Regards,

Praveen

Jan 10 '07 #1
1 1683
wrote on 10 jan 2007 in comp.lang.javascript:
Hi...,

We have a pretty huge form where the user/support spends more than
6 minutes. Now, behind the scenes, I wanted to capture the outerHTML
data & send it to a different URL to save it in draft.

Now there is no outerHTML in Firefox.
The outer element's innerHTML can be the inner's the outer one, methinks.
secondly even innerHTML is
different for IE & Firefox as in IE the updates I do to the text field
are now visible in the innerHTML text but the changes are not visible
when I run the javascript in Firefox.

For eg. if there is a Text Box which alreay has value "100" & I change
it to "1000". The innerHTML o/p in IE shows the value "1000" correctly
where as in Firefox it shows "100".

My main intention is to capture the current HTML state (along with the
changes) and post it to a different URL while the user is filling the
current form.
That seeme a bad idea, Praveen.

Do not expect different browsers to act the same while building the DOM
tree from the same html source.

All you need is the form's input content,
because the html is already known to you.

So why not use the DOM to collect that content and send it to the other
server using XMLHTTP.

You could do that, say, every 10 seconds or so.

=====================================

Something like [not tested, just an idea, read as pseudocode]:

var z = '';
var coll = document.forms[0].getElementsBytagName('input');
for (i in coll)
z += coll[i].name + ':' + coll[i].value.replace(/[:;]/g,'?') + ';'

var http = new ActiveXObject("Microsoft.XMLHTTP");
// do the good thing for FF too here [like new XMLHttpRequest();]
http.open("POST", "http://....", true[?]);
http.setRequestHeader("Content-Type", ....... );
http.send(z);
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Jan 11 '07 #2

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

Similar topics

12
by: jonathan.beckett | last post by:
Hi All, For the past few months I have been working on an open source Apache/PHP/MySQL content management system - and have recently made it available for download. It's still very much a...
0
by: jonathan.beckett | last post by:
Hi All, I have just made version 0.4.8 of the PluggedOut CMS Content Management System available for download - it's free, and covered by the GPL. It's still very much a work in progress...
1
by: Rick Strahl [MVP] | last post by:
I often have the need to run templates that perform the equivalent of a mail merge as part of the processing for another page. For example, I have an invoice display page in my admin module and...
4
by: Steve Wolfie | last post by:
Hello all: Again, let me thank everyone who has helped in the past. Can't wait till I can help out with some advice of my own. Now, I am building an app that wishes to retrieve the output of...
7
by: Water Cooler v2 | last post by:
I know what it is, and yet the knowledge of what a CMS is, is so vague that I find myself asking this question every now and then. I've googled and read the resources too. However, the knowledge is...
0
by: Managed Code | last post by:
Hello All, Here is my issue and thanks in advance for any assistance. I have a base page with a dropdownlist that fires an event with the selected index. The content page catches the event and...
4
by: miha.vitorovic | last post by:
Hi all. I know this is more of a DOM question, but here it goes: Browser == Firefox suppose I have two frames. One has many links and is opening pages in the other one. I would like to check...
9
by: pbd22 | last post by:
Hi. This is just a disaster management question. I am using XMLHTTP for the dynamic loading of content in a very crucial area of my web site. Same as an IFrame, but using XMLHTTP and a DIV. I...
2
by: pankajsingh5k | last post by:
Dear All, Please help me... I had read an article to lazy load a tab in a tabcontainer using an update panel on http://mattberseth.com/blog/2007/07/how_to_lazyload_tabpanels_with.html ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
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
0
BarryA
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
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...
0
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,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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...

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.