Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > Running a JavaScript function server-side

Reply
Thread Tools

Running a JavaScript function server-side

 
 
David C. Holley
Guest
Posts: n/a
 
      05-04-2004
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.

 
Reply With Quote
 
 
 
 
Aaron Bertrand [MVP]
Guest
Posts: n/a
 
      05-04-2004
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" <> wrote in message
news:...
> 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.
>



 
Reply With Quote
 
 
 
 
David Holley
Guest
Posts: n/a
 
      05-04-2004
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!
 
Reply With Quote
 
Bob Barrows [MVP]
Guest
Posts: n/a
 
      05-04-2004
David Holley wrote:
> 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?


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.

>
> ***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.


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.


 
Reply With Quote
 
Aaron Bertrand - MVP
Guest
Posts: n/a
 
      05-04-2004
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]" <> wrote in message
news:eg$...
> David Holley wrote:
> > 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?

>
> 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.
>
> >
> > ***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.

>
> 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.
>
>



 
Reply With Quote
 
Bob Barrows [MVP]
Guest
Posts: n/a
 
      05-04-2004
I was thinking of the first one, but the other one is good too.
Bob
--
Microsoft MVP -- ASP/ASP.NET
..
"Aaron Bertrand - MVP" <> wrote in message
news:...
> Maybe you mean one of these?
>
> http://www.aspfaq.com/2045
> http://www.aspfaq.com/2208
>



 
Reply With Quote
 
 
 
Reply

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 On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Running a C++ Library Function or Executable Using JavaScript Peter Lauren Javascript 4 05-02-2011 10:02 AM
Running javascript function after page renders in firefox? cjl Javascript 4 07-07-2005 06:12 PM
running javascript function on a webcontrol hemant ASP .Net 2 01-31-2005 10:13 AM
write a function such that when ever i call this function in some other function .it should give me tha data type and value of calling function parameter komal C++ 6 01-25-2005 11:13 AM
running javascript function on load Sanjay Goel Javascript 1 07-09-2003 02:31 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57