Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Calling a JavaScript function within ASP>??

Status
Not open for further replies.

golyg

Programmer
Jul 22, 2002
319
US
I am new at this and wondering if you can call a javascript
function/or a vbscript procedure within asp code and then call an asp function within the javascript function/or vbscript).

 
The important distinction here is that you are attempting to call a client-side script from the server, and then turn around and call a server-side script from the client. The important thing to remember about the web is that it is connectionless. What this means is that a client sends a query to a server without creating a connection. Once that query is sent, there is no interaction. If the server returns information, it sends it as a flat file and then is done with that client. The client receives the file and displays it.
The short of the matter is that a server side script executes on the server with no connection to the client(generally speaking). When it has finished executing it sends the resulting file to the client. Server side script cannot execute client-side script on the client directly, and client-side scripts cannot execute server-side scripts directly. There are ways to get around this, to fake it, if you will.
The server pre-processess the page, the client processes the page. Just about everything else is a workaround.
-Tarwn
 
That's assuming you weren't just trying to use Javascript ASP from VBScript ASP and vise-versa, which is a piece of cake. To continue the notes above, ASP (Active Server Pages) can be written in VBScript or Javascript, and is code executed on the Server. codestorm
Fire bad. Tree pretty. - Buffy
select * from population where talent > 'average'
You're not a complete programmer unless you know how to guess.
I hope I never consider myself an 'expert'.
<insert witticism here>
 
Thanks for the advice codestorm
but you state its a &quot;piece of cake&quot;.
I have been running into a error stating
&quot;document.directoryIcon.src is null or not an object&quot;
I imagine it has to do with being client-side function?

Because it just couldn't be my code! :>

Thanks again
 
Thanks for the advice codestorm
but you state its a &quot;piece of cake&quot;.
I have been running into a error stating
&quot;document.directoryIcon.src is null or not an object&quot;
I imagine it has to do with being client-side function?
any suggestions?

Because it just couldn't be my code! :>

Thanks again
 
Usual go here is to post the code with the problem, and let us all have a hack at it. codestorm
Fire bad. Tree pretty. - Buffy
select * from population where talent > 'average'
You're not a complete programmer unless you know how to guess.
I hope I never consider myself an 'expert'.
<insert witticism here>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top