javascript calling asp function

B

Bob Barrows [MVP]

Sehboo said:
How can I call asp function from javascript?

"javascript"? I assume you mean "client-side code", which can be written in
other script languages besides javascript, depending on browser support ...
Since this is a client-side question, it's offtopic for this newsgroup. You
should post any followup questions to an appropriate group such as
..scripting.jscript.

Anyways, the answer is:
By requesting the page containing the function from the server.

There are several techniques via which this can be accomplished: img
elements, iframes, remote scripting, xmlhttprequest. The technique you use
depends on whether you need to receive a value back from the server-side
function.

Bob Barrows
 
B

Bullschmidt

Don't know if this might give you any ideas.

JavaScript function with an ASP variable.
Response.Write "<script type='text/javascript'>alert('" &
strMyASPVariable & "');</script>"

JavaScript function with hardcoded text:
Response.Write "<script type='text/javascript'>alert('Yet to be
developed.');</script>"

Best regards,
J. Paul Schmidt, Freelance Web and Database Developer
http://www.Bullschmidt.com
Access Database Sample, Web Database Sample, ASP Design Tips
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,014
Latest member
BiancaFix3

Latest Threads

Top