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

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.

Jul 19 '05 #1
5 2341
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" <Da**********@netscape.net> wrote in message
news:OZ**************@TK2MSFTNGP12.phx.gbl...
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.

Jul 19 '05 #2
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!
Jul 19 '05 #3
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.
Jul 19 '05 #4
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]" <re******@NOyahoo.SPAMcom> wrote in message
news:eg**************@TK2MSFTNGP12.phx.gbl...
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.

Jul 19 '05 #5
I was thinking of the first one, but the other one is good too.
Bob
--
Microsoft MVP -- ASP/ASP.NET
..
"Aaron Bertrand - MVP" <aa***@TRASHaspfaq.com> wrote in message
news:ux**************@TK2MSFTNGP10.phx.gbl...
Maybe you mean one of these?

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

Jul 19 '05 #6

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

Similar topics

6
by: von | last post by:
Is it possible to run a Perl script from within a javascript? I have an existing javascript that provides some data - and I want to write that data to a text file on my server via a Perl script...
14
by: tshad | last post by:
I posted this on the asp.net group, also. I wasn't sure whether this was an asp.net problem or a javascript problem. I have a page that was originally created from a program I found on the net...
2
by: K | last post by:
Hello there, this is my first time using these google groups..so if i'm doing somethign wrong or in the wrong place let me know What i'm trying to do is use the XMLHttpRequest object to send a...
0
by: Prescott | last post by:
I want to execute a javascript function that will set a value in the parent window from the child widow where its called and then post the form to the server. I seem to be able to execute one or...
0
by: Michelle Keys | last post by:
I am trying to call a print function to print a string from a database using javascript. Which is RC_DATA of Varchar2(2500). This is a javascript is not being used. I have a thing that needs to...
14
by: Rich | last post by:
I am converting my enterprise solution from VS 2003 (.NET v1.1.4322) to VS 2005 (.NET v2.0.50727). The entire solution uses serveral technologies - Windows Server 2003 (AD, SQL Server 2000, IIS,...
1
by: daniel_xi | last post by:
Hi all, I am running a VS 2003 .NET project on my client machine (Win 2000 SP4, ..NET framework 1.1), running an ASP.NET application on a remote web server (Win 2000 Server, IIS 6.0, .NET...
7
by: dukey11 | last post by:
I want to run some javascript code and then some ASP.NET code. I can do both function seperately by pressing two different objects. But I cannot to then off one object. Below I have: > An...
1
by: KRISHNA PRAVI | last post by:
the error is "runtime error object expected" here is the code....................................................................................... <script language="javascript"...
5
by: loveshack | last post by:
Can anyone help me please (i am quite a novice, but having fun learning). Im not sure if this is an ASP problem, a javascript problem or a browser problem. Firstly, everything i have written...
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: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

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.