Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

getting return value of javascript function

203 views
Skip to first unread message

Steven

unread,
Sep 22, 2008, 2:29:43 AM9/22/08
to
Hi,
I know how to get the value of a javascript variable in a webbrowser, and
how to call a javascript function. But I can't find how to get the return
value of a function.
Any ideaz?
TIA
Steven


Kent Briggs

unread,
Sep 22, 2008, 11:03:56 AM9/22/08
to
Steven wrote:
> Hi,
> I know how to get the value of a javascript variable in a webbrowser, and
> how to call a javascript function. But I can't find how to get the return
> value of a function.

You mean like this?

function addNumbers(n1,n2)
{
return n1 + n2;
}

var sum = addNumbers(1,2);


--
Kent Briggs, kbr...@spamcop.net
Briggs Softworks, http://www.briggsoft.com

Steven

unread,
Sep 22, 2008, 12:07:55 PM9/22/08
to
"Kent Briggs" <kbr...@spamcop.net> wrote in message
news:gaidnVMyCK1BLkrV...@comcast.com...

> Steven wrote:
>> Hi,
>> I know how to get the value of a javascript variable in a webbrowser, and
>> how to call a javascript function. But I can't find how to get the return
>> value of a function.
>
> You mean like this?
>
> function addNumbers(n1,n2)
> {
> return n1 + n2;
> }
>
> var sum = addNumbers(1,2);
>

You mean, like first put the return value in a variable of the HTML
document, and read that value from my Delphi app? Well, it's an idea, but
actually I was wondering if it could be done directly?
Thanks for the reply anyway.
Steven


Kent Briggs

unread,
Sep 22, 2008, 1:17:58 PM9/22/08
to
Steven wrote:

> You mean, like first put the return value in a variable of the HTML
> document, and read that value from my Delphi app? Well, it's an idea, but
> actually I was wondering if it could be done directly?
> Thanks for the reply anyway.

Javascript is executed by the client browser. What exactly are you
trying to do with a Delphi app? Is your Delphi app an HTTP server?

huangshu...@163.com

unread,
Nov 4, 2008, 7:31:40 PM11/4/08
to
who help me resovle this?

Rob Kennedy

unread,
Nov 4, 2008, 8:58:48 PM11/4/08
to
huangshu...@163.com wrote:

> Steven wrote:
>> I know how to get the value of a javascript variable in a webbrowser, and
>> how to call a javascript function. But I can't find how to get the return
>> value of a function.
>> Any ideaz?
>
> who help me resovle this?

Before you get help, please show that you have read the rest of this
thread. Then, ask a specific question.

--
Rob

0 new messages