Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old July 19th, 2005, 01:06 PM
David C. Holley
Guest
 
Posts: n/a
Default Running a JavaScript function server-side

How would I run a JavaScript function in a *.asp page and then pass the
value returned to VBScript for further processing? ***Converting the
function to VBScript is *NOT* an option.

  #2  
Old July 19th, 2005, 01:06 PM
Aaron Bertrand [MVP]
Guest
 
Posts: n/a
Default Re: Running a JavaScript function server-side

A *client-side* JavaScript function? You can't do that in a single load of
an ASP page. You would have to submit a form or redirect or something along
those lines. Here is the order of operations:

(a) browser requests ASP page

(b) server-side code runs

(c) client-side code runs (at this point, there is nothing left but HTML; no
server-side functions, no access to server-side databases, no ability to set
session variables, etc)

See http://www.aspfaq.com/2281 for some workarounds (this revolves around
setting session variables, but you could use it to do any further
server-side processing). Note that anything you do on the server (e.g. set
a session variable) is not available until you request another ASP page,
because of the order of operations described above. The current ASP page
simply does not contain any ASP by the time an end user can interact with
the client-side script.

--
Aaron Bertrand
SQL Server MVP
http://www.aspfaq.com/


"David C. Holley" <DavidCHolley@netscape.net> wrote in message
news:OZyRvYYMEHA.3216@TK2MSFTNGP12.phx.gbl...[color=blue]
> How would I run a JavaScript function in a *.asp page and then pass the
> value returned to VBScript for further processing? ***Converting the
> function to VBScript is *NOT* an option.
>[/color]


  #3  
Old July 19th, 2005, 01:07 PM
David Holley
Guest
 
Posts: n/a
Default Re: Running a JavaScript function server-side

Let me restate that...

How would I run a JavaScript function SERVER-SIDE in a *.asp page and
then pass the value returned to VBScript for further processing?
***Converting the function to VBScript is *NOT* an option.

I seem to recall seeing that a *.asp can execute JavaScript. If I'm not
mistaken.



*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
  #4  
Old July 19th, 2005, 01:07 PM
Bob Barrows [MVP]
Guest
 
Posts: n/a
Default Re: Running a JavaScript function server-side

David Holley wrote:[color=blue]
> Let me restate that...
>
> How would I run a JavaScript function SERVER-SIDE in a *.asp page and
> then pass the value returned to VBScript for further processing?[/color]

Create a server-side javascript script block in which you place your
javascript function. then call the function from your server-side vbscript
script block.

There is an article at www.aspfaq.com about doing this, but I don't have
time to search for it right now, so I suggest you do so.
[color=blue]
>
> ***Converting the function to VBScript is *NOT* an option.
> I seem to recall seeing that a *.asp can execute JavaScript. If I'm
> not mistaken.[/color]

You're not mistaken: ASP supports both vbscript and
jscript/javasctipt/ECMAscript


Bob Barrows

--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.


  #5  
Old July 19th, 2005, 01:07 PM
Aaron Bertrand - MVP
Guest
 
Posts: n/a
Default Re: Running a JavaScript function server-side

Maybe you mean one of these?

http://www.aspfaq.com/2045
http://www.aspfaq.com/2208

--
Aaron Bertrand
SQL Server MVP
http://www.aspfaq.com/




"Bob Barrows [MVP]" <reb01501@NOyahoo.SPAMcom> wrote in message
news:eg$9tUdMEHA.2100@TK2MSFTNGP12.phx.gbl...[color=blue]
> David Holley wrote:[color=green]
> > Let me restate that...
> >
> > How would I run a JavaScript function SERVER-SIDE in a *.asp page and
> > then pass the value returned to VBScript for further processing?[/color]
>
> Create a server-side javascript script block in which you place your
> javascript function. then call the function from your server-side vbscript
> script block.
>
> There is an article at www.aspfaq.com about doing this, but I don't have
> time to search for it right now, so I suggest you do so.
>[color=green]
> >
> > ***Converting the function to VBScript is *NOT* an option.
> > I seem to recall seeing that a *.asp can execute JavaScript. If I'm
> > not mistaken.[/color]
>
> You're not mistaken: ASP supports both vbscript and
> jscript/javasctipt/ECMAscript
>
>
> Bob Barrows
>
> --
> Microsoft MVP -- ASP/ASP.NET
> Please reply to the newsgroup. The email account listed in my From
> header is my spam trap, so I don't check it very often. You will get a
> quicker response by posting to the newsgroup.
>
>[/color]


  #6  
Old July 19th, 2005, 01:07 PM
Bob Barrows [MVP]
Guest
 
Posts: n/a
Default Re: Running a JavaScript function server-side

I was thinking of the first one, but the other one is good too.
Bob
--
Microsoft MVP -- ASP/ASP.NET
..
"Aaron Bertrand - MVP" <aaron@TRASHaspfaq.com> wrote in message
news:uxgJetdMEHA.2976@TK2MSFTNGP10.phx.gbl...[color=blue]
> Maybe you mean one of these?
>
> http://www.aspfaq.com/2045
> http://www.aspfaq.com/2208
>[/color]


 

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles