Re: get object name from within object
Available news archives: comp.lang.tcl - comp.lang.python - comp.security.firewalls - sci.crypt - comp.lang.php - comp.lang.javascript
Google
 
Web news.hping.org


comp.lang.javascript archive

Re: get object name from within object

From: warteschlange <andres@holzapfel.ch>
Date: Sun Jul 24 2005 - 11:38:08 CEST

Richard Cornford wrote:
>...

what you are saying in other words: keep javascript clean and do all
the crap on the php side.

My aproach was sending a list of functions from php to javascript,
allowed to use. Just a list (getMethods() ) as usual in xml_rpc. This
is an array of strings.
And: if i have a nice working backend, why writing another interface?

So the original question was: how to get a function, with its name as
argument, from a string.
Hey, why not use eval? Answer: I don't like eval at all.
I try to keep it simple and avoid the xml_rpc/soap overhead.

I got all the good answers very quick and came to the conclusion, that
it is easier to solve it in php with a wrapper. But now i'm spending my
time chatting around justifying my aproach.

Just asking a good question and not explaining all the background, does
not automatically mean, that he/she is not aware of the rest. I
thought, pointing out
> don't remind me:
> * this works only 'sync' and it can block the browser
> * i know AJAX/XML_RPC/SOAP
will avoid a discussion about these items.

But i was wrong.

So why not introduce a syntax in the discussons for marking out items
not to be discussed?
example:
my son (9) want to see '''Once upon a time in Mexico'''
question: are there any sequences of violence?
 [avoid_topics_in_this_thread]
   quality of the movie
   why Rodriquez filmed in HDTV
   beauty of Hayek, Mendes
 [/avoid_topics_in_this_thread]

this will help to focus.

Sync is not a bad idea, it is just bad implemented in the browsers.
(Other languages have a lot better mechanism to fetch a result from a
function without blocking the rest, if needed : vb/c++/j++ ).
[avoid_topics_in_this_thread]
 sync/async
[avoid_topics_in_this_thread]

Andres Obrero
Received on Tue Oct 18 03:00:39 2005