473,473 Members | 1,577 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Saving modified DOM state

I am building an SVG interface (with Javascript) for client side control
of some hardware. The svg will be hosted on a micro PC
(http://www.picotux.com/indexe.html). It runs a uClinux OS with GCC 3.4.4
for C++ (and Fortran??) and a Web Server and Telnet and not much more.

My SVG seems to be working fine and using Firefox's DOM browser I can see
it change. What I can't do is find a way to capture these DOM state
changes. All I need is to capture timer events from my SVG and convert
them into CRON events in a config file and use CRON to kick a small
program on/off appropriately. This will in-turn turn a serial port pin
high or low - this controls a relay, which turns my hardware on and off at
the set times. Simple really :o)

Obviously, this needs to all be very lightweight. I don't think there's
room for a JVM and I don't know C++. So, if anyone knows a simple
solution to saving DOM state or wants to volunteer to program it in C++
for me, I'd be very happy.

Thanks in advance,
Greg
Apr 24 '06 #1
2 2158


Greg wrote:

My SVG seems to be working fine and using Firefox's DOM browser I can see
it change. What I can't do is find a way to capture these DOM state
changes.


I am not sure what exactly you want to achieve. If you want to serialize
the current DOM of the SVG document in Mozilla then you can use e.g.
var serializedMarkup = new XMLSerializer().serializeToString(document);

If you want to post the current document to the server you can use e.g.
var httpRequest = new XMLHttpRequest();
httpRequest.open('POST', 'save.cgi', true);
httpRequest.send(document);
where save.cgi then finds the serialized SVG markup in the HTTP request
body.

If you want to have listeners reacting to changes in the DOM then
Mozilla has some support for W3C DOM Level 2 Mutation Events.

--

Martin Honnen
http://JavaScript.FAQTs.com/
Apr 24 '06 #2
Martin,

Just to recap the requirements then:

I serve some SVG to an SVG capable web client browser (eg, Firefox 1.5).

I change the state of the SVG on the client browser, so it now contains
some timer information that I want to use to control some hardware
attached to the server.

I capture the timer information from the client side SVG DOM back to the
server, in a format recognised by a timer that will use it to run a
program that turns the hardware on or off, via the serial port.

The hardware has a C++ compiler and a Web Server and hopefully enough room
for a couple of small C++ programs.

Does that help?

I've stated it in terms of a use case scenario, rather than a
technology description as it's the technology bit that I need help on, to
meet the requirements. You'll probably need to explain serialization or
listners, assuming they do what I need them to do?

Cheers,

Greg
Apr 25 '06 #3

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

Similar topics

4
by: Jacob H | last post by:
Hello list... I'm developing an adventure game in Python (which of course is lots of fun). One of the features is the ability to save games and restore the saves later. I'm using the pickle...
5
by: Michael Albanese | last post by:
Can you save objects a (custom class) to Viewstate and then get them on a later page?? I have a custom class for an ASP.Net application that I would like to make available across several web...
1
by: Mahesh Devjibhai Dhola [MVP] | last post by:
Hi, User can adjust the size of columns of a table or the position of splitter in UI. We want these adjustments to be remembered when we restart the application. Currently, we are saving these...
4
by: John Kandell | last post by:
Hi, I posted this in the asp.net group, but didn't get a response. Maybe someone here can help me with this... --- Would someone be able to shed some light on what is the cost of saving a...
2
by: Børge Hansen | last post by:
Hi. I am trying to create functionality for saving the contents (state) of a page. The idea is that when navigating away from a webpage and later returning the state of the textboxes, etc should...
1
by: WhiskyRomeo | last post by:
Since I can't get answer from the author, can someone address this? In this article . . . http://msdn.microsoft.com/msdnmag/issues/04/05/DataPoints/default.aspx In the "The Transaction and...
12
by: sandravandale | last post by:
It's important that I can read the contents of the dict without flagging it as modified, but I want it to set the flag the moment I add a new element or alter an existing one (the values in the...
15
by: Marcus Kwok | last post by:
How do you save the formatting options for a stream? In the program below, notice that when I define my operator<<() for the custom type, it permanently changes the output format of the stream: ...
102
by: hug | last post by:
www.webmaster, was suggested that this ng could be a better place.] I've updated my test server to handle if-modified-since. I've noticed that the (old copies I run of) IE and Netscape seem...
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
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,...
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...
1
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...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.