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

transferring dom/value pairs

esj
let me say up front that my experience with JavaScript and "Ajax"
interactions has been horrific. There are weeks I will never get back
because of it. Whenever I encounter something so horrific that it
makes me blank my memories of the event, I find myself going back and
trying to take different approaches to understanding what happens.

This current round of experiments involves sending and receiving what
is effectively an associative array. That is, I want to send dom names
and the associated values via XMLHttpRequest calls and on return, get a
set of dom value pairs and push them back into the current environment
in the browser.

what I need to figure out how to do is associate a series of DOM's with
a button, extract the information when the button is pressed, and then
present the entire array to a CGI. On return, I would need to take the
same array from the CGI and transfer the contents into the specified
DOM's

if this is not practical, tell me so and I go do something else which
is probably more fun. If it is practical and has been implemented in
some toolkit, fantastic. It saves me some pain. If it hasn't been
implemented, well, there goes the more hours that I will never get
back. ;-)

looking forward to your educated and wonderful responses.

---eric

Jul 26 '06 #1
7 1515
My recommendations are:
for the first part of your post, Kleenex.
for the second, JSON ( http://json.org/ )

Jul 26 '06 #2
esj

Paul Davis wrote:
My recommendations are:
for the first part of your post, Kleenex.
for the second, JSON ( http://json.org/ )
Thank you for that reply. I will look in to the both of them. With
any luck, I will be able to cut down the toolkit to the minimum I need
and let me do all of my operations on the server.

searching, I couldn't find Kleenex but I did find
http://www.mochikit.com/ as well as a few others. Since mochikit was
described as having a more Python like aspect, I'm going to look at
that more closely.

thanks again.

---eric

Jul 26 '06 #3
Sorry, I was being sarcastic
http://www.kleenex.com

Jul 26 '06 #4
~A!

Paul Davis wrote:
My recommendations are:
for the first part of your post, Kleenex.
for the second, JSON ( http://json.org/ )
I'm with Paul. JSON is easy for JavaScript, and there will be an esay
toolkit for whatever language you're working with on the back end. You
really should give it a shot. It's not as standard as XML just yet, but
it is coming up fast.

~A!

Jul 27 '06 #5
es*@harvee.org wrote:
<snip>
>... , I want to send dom names and the associated values via
XMLHttpRequest calls and on return, get a set of dom value
pairs and push them back into the current environment
in the browser.
<snip>
>... associate a series of DOM's with a button ...
<snip>

"Dom names", "dom value pairs", "associate a series of DOM's with a
button "?

You terminology is divorced from browser scripting with javascript. You
may have some idea of what you are trying to do but everyone else is
going to have to guess. If you want help actually doing this you will
have to explain what it is you are actually trying to do.

Richard.

Jul 27 '06 #6
esj
Richard Cornford wrote:
es*@harvee.org wrote:
You
may have some idea of what you are trying to do but everyone else is
going to have to guess. If you want help actually doing this you will
have to explain what it is you are actually trying to do.
what I'm trying to do is avoid writing any JavaScript yet still provide
the same degree of web page control that JavaScript provides. and yes,
I'm trying to avoid a full round-trip page reconstruction just like
JavaScript/Ajax. for what it's worth, I've gone to the same 90% case
simplification with HTML and cgi by extending aether in the akasha
project (google aether manual for a very rough idea)

in order to avoid writing JavaScript, I believe it is necessary to be
able to tell the server-side program something about the current state
of the region of interest. Region of interest can be a form, a div
area, or what ever you want to be. State is defined by keyvalue pairs.
The key is the DOM reference either full path or by ID. a full path
would be something like:

html>body>div#if_layout>div#if_body>div#btm

and id reference should be something as simple as: div#btm

associated with each key is some data element. It may be some HTML, it
may be the data inside of a form element. It really doesn't matter as
long as it's readable.

Associated with a button or some other form of screen element calling
the user to action, should be a set of keys. When that button is
pressed, the keys retrieve the data and are sent as a bundle to the
appropriate server-side action.

on return, a similar set of key value pairs would be returned and the
keys with specify where to place the data. So one could in theory
modify a small section of the web page to change what's visible etc..

That's what I'm trying to do. I've gotten some really good advice so
far or which I'm very grateful. As I have the time I'm going to
experiment with this technique. If it yields something, hooray. If it
doesn't, well there goes a few more hours I will never get back.

besides the fact that I have been burned so horribly by raw JavaScript,
what's motivating me is the desire to create a collaborative commenting
system for writers. I don't want editing because as an author, I want
to control the changes. But I do want reviewer's to comment on the
body of the text. The user interface would be something like
highlighting the information on the web page, doing some magic
incantation with the mouseto bring up a text area in a margin. They
edit their work in the text area, save it, and continue on. As an
author, I should be able to see the regions they have commented on and
the comments so I can decide to incorporate what's important.

again, web page displays document, reviewer highlights region, text
area becomes available, reviewer enters comments, comments saved,
author of use comments, author swears that reviewers are idiots.

that's what's motivating me right now. I want to build that but I
don't want to waste my time with JavaScript "quirks" if it's at all
possible.

Jul 27 '06 #7
esj

~A! wrote:
Paul Davis wrote:
My recommendations are:
for the first part of your post, Kleenex.
for the second, JSON ( http://json.org/ )

I'm with Paul. JSON is easy for JavaScript, and there will be an esay
toolkit for whatever language you're working with on the back end. You
really should give it a shot. It's not as standard as XML just yet, but
it is coming up fast.
again thank you. I have looked at this and it looks like a really
superior notation for communicating data elements around a network.
I'll probably use it in my Python work in preference to other
techniques.

this is much appreciated.

---eric

Jul 27 '06 #8

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

Similar topics

6
by: Equis Uno | last post by:
Hi, Assume I'm given a 100k file full of key-value pairs: date,value 26-Feb-04,36.47 25-Feb-04,36.43 24-Feb-04,36.30 23-Feb-04,37.00 20-Feb-04,37.00
3
by: He Shiming | last post by:
Hi Folks, Happy holidays! I have a question regarding STL multimap. Basically, the current multimap<int,int> look like this: key=>value 1=>10, 1=>20, 1=>30,
3
by: Jeff L. | last post by:
I have an interesting problem and I'm not coming up with any answers in my searches, so hopefully someone can give me a hand with this. I have a feeling it's easy, but I usually get my nose stuck...
6
by: Evyn | last post by:
Hi, How do I compare 2 maps for identical keys, and if they have identical keys, check if they have identical values? In either case I want to copy ONLY that key value pair to one of two...
2
by: Sehboo | last post by:
I am trying to use key value pair list, but I don't want to use sorted list because it messes up my order. I am not sure what other options I have. Can anybody point? Thanks
0
by: =?Utf-8?B?SGVucnlDQw==?= | last post by:
We are trying to develop a set of C# 2.0 web services that are data driven, loosely coupled, easy to maintain, and somewhat high preferment (I'm sure that's either an oxymoron or everyone else's...
3
by: Christof Warlich | last post by:
Hi all, in the following example, Index<unsigned int x>::value allows to calculate the "rounded up" index from any "increasing" value during compile time. Unfortunately, the definition of the...
3
by: JCCDevel | last post by:
Hi All, I'm not too proficient in Javascript but am trying to help a friend out. Bascially, the page we are having trouble with is loaded with a numerical value in the url string. Example: ...
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: 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?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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.